openfox 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/agent-defaults/builder.agent.md +38 -0
  2. package/dist/agent-defaults/code-reviewer.agent.md +21 -0
  3. package/dist/agent-defaults/debugger.agent.md +21 -0
  4. package/dist/agent-defaults/planner.agent.md +35 -0
  5. package/dist/agent-defaults/test-generator.agent.md +22 -0
  6. package/dist/agent-defaults/verifier.agent.md +41 -0
  7. package/dist/{chunk-FF6Z2MC3.js → chunk-5ZUU23XF.js} +18 -1
  8. package/dist/{chunk-IVHCPQO2.js → chunk-ARFK3RZW.js} +1 -1
  9. package/dist/{chunk-IKAWIOXM.js → chunk-FUUYYDVG.js} +387 -73
  10. package/dist/{chunk-YQ36AK5A.js → chunk-JFQEATRC.js} +623 -327
  11. package/dist/{chunk-43SWNGYW.js → chunk-L475ND2Z.js} +9 -9
  12. package/dist/{chunk-6MOGZMGX.js → chunk-L4XDA3V7.js} +2 -2
  13. package/dist/{chunk-EI46G5WO.js → chunk-MKAHOQBI.js} +10 -10
  14. package/dist/cli/dev.js +1 -1
  15. package/dist/cli/index.js +1 -1
  16. package/dist/{config-6GJ4SVFH.js → config-BMXSDOZB.js} +3 -3
  17. package/dist/{init-UVZDOHMX.js → init-PLRTRSDC.js} +6 -6
  18. package/dist/{protocol-BJsm88OW.d.ts → protocol-BFFz3WM0.d.ts} +14 -3
  19. package/dist/{provider-LCE6WZA6.js → provider-ETVY64A2.js} +5 -5
  20. package/dist/{serve-27DZK34K.js → serve-EOKIXTWM.js} +8 -8
  21. package/dist/server/index.d.ts +1 -1
  22. package/dist/server/index.js +5 -5
  23. package/dist/shared/index.d.ts +2 -2
  24. package/dist/shared/index.js +1 -1
  25. package/dist/{tools-R4YQAYUF.js → tools-QMIIDJTV.js} +7 -5
  26. package/dist/web/assets/index-CAD7Iv_d.js +122 -0
  27. package/dist/web/assets/{index-BSlSWZrM.css → index-DHmZmhnR.css} +1 -1
  28. package/dist/web/index.html +2 -2
  29. package/dist/workflow-defaults/default.workflow.json +45 -0
  30. package/package.json +34 -16
  31. package/dist/branch.api-WDHKZJS6.js.map +0 -1
  32. package/dist/chunk-26NRL3HX.js.map +0 -1
  33. package/dist/chunk-43SWNGYW.js.map +0 -1
  34. package/dist/chunk-4Z2OZ6NX.js.map +0 -1
  35. package/dist/chunk-6MOGZMGX.js.map +0 -1
  36. package/dist/chunk-AF7XS4OI.js.map +0 -1
  37. package/dist/chunk-EI46G5WO.js.map +0 -1
  38. package/dist/chunk-FF6Z2MC3.js.map +0 -1
  39. package/dist/chunk-IKAWIOXM.js.map +0 -1
  40. package/dist/chunk-IVHCPQO2.js.map +0 -1
  41. package/dist/chunk-MTX5Y3V3.js.map +0 -1
  42. package/dist/chunk-N2XYX4ZA.js.map +0 -1
  43. package/dist/chunk-QY7BMXWT.js.map +0 -1
  44. package/dist/chunk-U62ZECSQ.js.map +0 -1
  45. package/dist/chunk-YQ36AK5A.js.map +0 -1
  46. package/dist/cli/dev.js.map +0 -1
  47. package/dist/cli/index.js.map +0 -1
  48. package/dist/config-6GJ4SVFH.js.map +0 -1
  49. package/dist/init-UVZDOHMX.js.map +0 -1
  50. package/dist/paths-4BPXWB2W.js.map +0 -1
  51. package/dist/project-creator-CWPKRIKI.js.map +0 -1
  52. package/dist/provider-LCE6WZA6.js.map +0 -1
  53. package/dist/serve-27DZK34K.js.map +0 -1
  54. package/dist/server/index.js.map +0 -1
  55. package/dist/settings-D5O3TMLD.js.map +0 -1
  56. package/dist/shared/index.js.map +0 -1
  57. package/dist/tools-R4YQAYUF.js.map +0 -1
  58. package/dist/web/assets/index-BMNDCsbJ.js +0 -120
  59. /package/dist/command-defaults/{defaults/commit-push.command.md → commit-push.command.md} +0 -0
  60. /package/dist/command-defaults/{defaults/init.command.md → init.command.md} +0 -0
  61. /package/dist/command-defaults/{defaults/test-ui.command.md → test-ui.command.md} +0 -0
  62. /package/dist/skill-defaults/{defaults/playwright-cli.skill.md → playwright-cli.skill.md} +0 -0
@@ -1,120 +0,0 @@
1
- var iw=Object.defineProperty;var aw=(e,n,l)=>n in e?iw(e,n,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[n]=l;var Zl=(e,n,l)=>aw(e,typeof n!="symbol"?n+"":n,l);function sw(e,n){for(var l=0;l<n.length;l++){const i=n[l];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const c=Object.getOwnPropertyDescriptor(i,s);c&&Object.defineProperty(e,s,c.get?c:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function l(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(s){if(s.ep)return;s.ep=!0;const c=l(s);fetch(s.href,c)}})();function zs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nf={exports:{}},is={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var ab;function ow(){if(ab)return is;ab=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function l(i,s,c){var d=null;if(c!==void 0&&(d=""+c),s.key!==void 0&&(d=""+s.key),"key"in s){c={};for(var f in s)f!=="key"&&(c[f]=s[f])}else c=s;return s=c.ref,{$$typeof:e,type:i,key:d,ref:s!==void 0?s:null,props:c}}return is.Fragment=n,is.jsx=l,is.jsxs=l,is}var sb;function cw(){return sb||(sb=1,nf.exports=ow()),nf.exports}var u=cw(),rf={exports:{}},Ve={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var ob;function uw(){if(ob)return Ve;ob=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),y=Symbol.iterator;function v(z){return z===null||typeof z!="object"?null:(z=y&&z[y]||z["@@iterator"],typeof z=="function"?z:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,j={};function k(z,W,O){this.props=z,this.context=W,this.refs=j,this.updater=O||w}k.prototype.isReactComponent={},k.prototype.setState=function(z,W){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,W,"setState")},k.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function T(){}T.prototype=k.prototype;function C(z,W,O){this.props=z,this.context=W,this.refs=j,this.updater=O||w}var L=C.prototype=new T;L.constructor=C,N(L,k.prototype),L.isPureReactComponent=!0;var G=Array.isArray;function I(){}var R={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function U(z,W,O){var $=O.ref;return{$$typeof:e,type:z,key:W,ref:$!==void 0?$:null,props:O}}function D(z,W){return U(z.type,W,z.props)}function Q(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function M(z){var W={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(O){return W[O]})}var V=/\/+/g;function H(z,W){return typeof z=="object"&&z!==null&&z.key!=null?M(""+z.key):W.toString(36)}function q(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(I,I):(z.status="pending",z.then(function(W){z.status==="pending"&&(z.status="fulfilled",z.value=W)},function(W){z.status==="pending"&&(z.status="rejected",z.reason=W)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function B(z,W,O,$,ee){var re=typeof z;(re==="undefined"||re==="boolean")&&(z=null);var Y=!1;if(z===null)Y=!0;else switch(re){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(z.$$typeof){case e:case n:Y=!0;break;case x:return Y=z._init,B(Y(z._payload),W,O,$,ee)}}if(Y)return ee=ee(z),Y=$===""?"."+H(z,0):$,G(ee)?(O="",Y!=null&&(O=Y.replace(V,"$&/")+"/"),B(ee,W,O,"",function(Te){return Te})):ee!=null&&(Q(ee)&&(ee=D(ee,O+(ee.key==null||z&&z.key===ee.key?"":(""+ee.key).replace(V,"$&/")+"/")+Y)),W.push(ee)),1;Y=0;var le=$===""?".":$+":";if(G(z))for(var xe=0;xe<z.length;xe++)$=z[xe],re=le+H($,xe),Y+=B($,W,O,re,ee);else if(xe=v(z),typeof xe=="function")for(z=xe.call(z),xe=0;!($=z.next()).done;)$=$.value,re=le+H($,xe++),Y+=B($,W,O,re,ee);else if(re==="object"){if(typeof z.then=="function")return B(q(z),W,O,$,ee);throw W=String(z),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return Y}function P(z,W,O){if(z==null)return z;var $=[],ee=0;return B(z,$,"","",function(re){return W.call(O,re,ee++)}),$}function oe(z){if(z._status===-1){var W=z._result;W=W(),W.then(function(O){(z._status===0||z._status===-1)&&(z._status=1,z._result=O)},function(O){(z._status===0||z._status===-1)&&(z._status=2,z._result=O)}),z._status===-1&&(z._status=0,z._result=W)}if(z._status===1)return z._result.default;throw z._result}var ae=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},A={map:P,forEach:function(z,W,O){P(z,function(){W.apply(this,arguments)},O)},count:function(z){var W=0;return P(z,function(){W++}),W},toArray:function(z){return P(z,function(W){return W})||[]},only:function(z){if(!Q(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Ve.Activity=b,Ve.Children=A,Ve.Component=k,Ve.Fragment=l,Ve.Profiler=s,Ve.PureComponent=C,Ve.StrictMode=i,Ve.Suspense=p,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(z){return R.H.useMemoCache(z)}},Ve.cache=function(z){return function(){return z.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function(z,W,O){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var $=N({},z.props),ee=z.key;if(W!=null)for(re in W.key!==void 0&&(ee=""+W.key),W)!X.call(W,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&W.ref===void 0||($[re]=W[re]);var re=arguments.length-2;if(re===1)$.children=O;else if(1<re){for(var Y=Array(re),le=0;le<re;le++)Y[le]=arguments[le+2];$.children=Y}return U(z.type,ee,$)},Ve.createContext=function(z){return z={$$typeof:d,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:c,_context:z},z},Ve.createElement=function(z,W,O){var $,ee={},re=null;if(W!=null)for($ in W.key!==void 0&&(re=""+W.key),W)X.call(W,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(ee[$]=W[$]);var Y=arguments.length-2;if(Y===1)ee.children=O;else if(1<Y){for(var le=Array(Y),xe=0;xe<Y;xe++)le[xe]=arguments[xe+2];ee.children=le}if(z&&z.defaultProps)for($ in Y=z.defaultProps,Y)ee[$]===void 0&&(ee[$]=Y[$]);return U(z,re,ee)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(z){return{$$typeof:f,render:z}},Ve.isValidElement=Q,Ve.lazy=function(z){return{$$typeof:x,_payload:{_status:-1,_result:z},_init:oe}},Ve.memo=function(z,W){return{$$typeof:m,type:z,compare:W===void 0?null:W}},Ve.startTransition=function(z){var W=R.T,O={};R.T=O;try{var $=z(),ee=R.S;ee!==null&&ee(O,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(I,ae)}catch(re){ae(re)}finally{W!==null&&O.types!==null&&(W.types=O.types),R.T=W}},Ve.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},Ve.use=function(z){return R.H.use(z)},Ve.useActionState=function(z,W,O){return R.H.useActionState(z,W,O)},Ve.useCallback=function(z,W){return R.H.useCallback(z,W)},Ve.useContext=function(z){return R.H.useContext(z)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(z,W){return R.H.useDeferredValue(z,W)},Ve.useEffect=function(z,W){return R.H.useEffect(z,W)},Ve.useEffectEvent=function(z){return R.H.useEffectEvent(z)},Ve.useId=function(){return R.H.useId()},Ve.useImperativeHandle=function(z,W,O){return R.H.useImperativeHandle(z,W,O)},Ve.useInsertionEffect=function(z,W){return R.H.useInsertionEffect(z,W)},Ve.useLayoutEffect=function(z,W){return R.H.useLayoutEffect(z,W)},Ve.useMemo=function(z,W){return R.H.useMemo(z,W)},Ve.useOptimistic=function(z,W){return R.H.useOptimistic(z,W)},Ve.useReducer=function(z,W,O){return R.H.useReducer(z,W,O)},Ve.useRef=function(z){return R.H.useRef(z)},Ve.useState=function(z){return R.H.useState(z)},Ve.useSyncExternalStore=function(z,W,O){return R.H.useSyncExternalStore(z,W,O)},Ve.useTransition=function(){return R.H.useTransition()},Ve.version="19.2.4",Ve}var cb;function Nc(){return cb||(cb=1,rf.exports=uw()),rf.exports}var _=Nc();const ke=zs(_),dw=sw({__proto__:null,default:ke},[_]);var lf={exports:{}},as={},af={exports:{}},sf={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var ub;function fw(){return ub||(ub=1,(function(e){function n(B,P){var oe=B.length;B.push(P);e:for(;0<oe;){var ae=oe-1>>>1,A=B[ae];if(0<s(A,P))B[ae]=P,B[oe]=A,oe=ae;else break e}}function l(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var P=B[0],oe=B.pop();if(oe!==P){B[0]=oe;e:for(var ae=0,A=B.length,z=A>>>1;ae<z;){var W=2*(ae+1)-1,O=B[W],$=W+1,ee=B[$];if(0>s(O,oe))$<A&&0>s(ee,O)?(B[ae]=ee,B[$]=oe,ae=$):(B[ae]=O,B[W]=oe,ae=W);else if($<A&&0>s(ee,oe))B[ae]=ee,B[$]=oe,ae=$;else break e}}return P}function s(B,P){var oe=B.sortIndex-P.sortIndex;return oe!==0?oe:B.id-P.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],m=[],x=1,b=null,y=3,v=!1,w=!1,N=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function L(B){for(var P=l(m);P!==null;){if(P.callback===null)i(m);else if(P.startTime<=B)i(m),P.sortIndex=P.expirationTime,n(p,P);else break;P=l(m)}}function G(B){if(N=!1,L(B),!w)if(l(p)!==null)w=!0,I||(I=!0,M());else{var P=l(m);P!==null&&q(G,P.startTime-B)}}var I=!1,R=-1,X=5,U=-1;function D(){return j?!0:!(e.unstable_now()-U<X)}function Q(){if(j=!1,I){var B=e.unstable_now();U=B;var P=!0;try{e:{w=!1,N&&(N=!1,T(R),R=-1),v=!0;var oe=y;try{t:{for(L(B),b=l(p);b!==null&&!(b.expirationTime>B&&D());){var ae=b.callback;if(typeof ae=="function"){b.callback=null,y=b.priorityLevel;var A=ae(b.expirationTime<=B);if(B=e.unstable_now(),typeof A=="function"){b.callback=A,L(B),P=!0;break t}b===l(p)&&i(p),L(B)}else i(p);b=l(p)}if(b!==null)P=!0;else{var z=l(m);z!==null&&q(G,z.startTime-B),P=!1}}break e}finally{b=null,y=oe,v=!1}P=void 0}}finally{P?M():I=!1}}}var M;if(typeof C=="function")M=function(){C(Q)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,H=V.port2;V.port1.onmessage=Q,M=function(){H.postMessage(null)}}else M=function(){k(Q,0)};function q(B,P){R=k(function(){B(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(B){switch(y){case 1:case 2:case 3:var P=3;break;default:P=y}var oe=y;y=P;try{return B()}finally{y=oe}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(B,P){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var oe=y;y=B;try{return P()}finally{y=oe}},e.unstable_scheduleCallback=function(B,P,oe){var ae=e.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?ae+oe:ae):oe=ae,B){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=oe+A,B={id:x++,callback:P,priorityLevel:B,startTime:oe,expirationTime:A,sortIndex:-1},oe>ae?(B.sortIndex=oe,n(m,B),l(p)===null&&B===l(m)&&(N?(T(R),R=-1):N=!0,q(G,oe-ae))):(B.sortIndex=A,n(p,B),w||v||(w=!0,I||(I=!0,M()))),B},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(B){var P=y;return function(){var oe=y;y=P;try{return B.apply(this,arguments)}finally{y=oe}}}})(sf)),sf}var db;function mw(){return db||(db=1,af.exports=fw()),af.exports}var of={exports:{}},gn={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var fb;function pw(){if(fb)return gn;fb=1;var e=Nc();function n(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)m+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var i={d:{f:l,r:function(){throw Error(n(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},s=Symbol.for("react.portal");function c(p,m,x){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:b==null?null:""+b,children:p,containerInfo:m,implementation:x}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,gn.createPortal=function(p,m){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(n(299));return c(p,m,null,x)},gn.flushSync=function(p){var m=d.T,x=i.p;try{if(d.T=null,i.p=2,p)return p()}finally{d.T=m,i.p=x,i.d.f()}},gn.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,i.d.C(p,m))},gn.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},gn.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var x=m.as,b=f(x,m.crossOrigin),y=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;x==="style"?i.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:b,integrity:y,fetchPriority:v}):x==="script"&&i.d.X(p,{crossOrigin:b,integrity:y,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},gn.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var x=f(m.as,m.crossOrigin);i.d.M(p,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&i.d.M(p)},gn.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var x=m.as,b=f(x,m.crossOrigin);i.d.L(p,x,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},gn.preloadModule=function(p,m){if(typeof p=="string")if(m){var x=f(m.as,m.crossOrigin);i.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else i.d.m(p)},gn.requestFormReset=function(p){i.d.r(p)},gn.unstable_batchedUpdates=function(p,m){return p(m)},gn.useFormState=function(p,m,x){return d.H.useFormState(p,m,x)},gn.useFormStatus=function(){return d.H.useHostTransitionStatus()},gn.version="19.2.4",gn}var mb;function y0(){if(mb)return of.exports;mb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),of.exports=pw(),of.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var pb;function hw(){if(pb)return as;pb=1;var e=mw(),n=Nc(),l=y0();function i(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function d(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function f(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function p(t){if(c(t)!==t)throw Error(i(188))}function m(t){var r=t.alternate;if(!r){if(r=c(t),r===null)throw Error(i(188));return r!==t?null:t}for(var a=t,o=r;;){var h=a.return;if(h===null)break;var g=h.alternate;if(g===null){if(o=h.return,o!==null){a=o;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===a)return p(h),t;if(g===o)return p(h),r;g=g.sibling}throw Error(i(188))}if(a.return!==o.return)a=h,o=g;else{for(var S=!1,E=h.child;E;){if(E===a){S=!0,a=h,o=g;break}if(E===o){S=!0,o=h,a=g;break}E=E.sibling}if(!S){for(E=g.child;E;){if(E===a){S=!0,a=g,o=h;break}if(E===o){S=!0,o=g,a=h;break}E=E.sibling}if(!S)throw Error(i(189))}}if(a.alternate!==o)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?t:r}function x(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=x(t),r!==null)return r;t=t.sibling}return null}var b=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),C=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function M(t){return t===null||typeof t!="object"?null:(t=Q&&t[Q]||t["@@iterator"],typeof t=="function"?t:null)}var V=Symbol.for("react.client.reference");function H(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===V?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case N:return"Fragment";case k:return"Profiler";case j:return"StrictMode";case G:return"Suspense";case I:return"SuspenseList";case U:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case w:return"Portal";case C:return t.displayName||"Context";case T:return(t._context.displayName||"Context")+".Consumer";case L:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case R:return r=t.displayName||null,r!==null?r:H(t.type)||"Memo";case X:r=t._payload,t=t._init;try{return H(t(r))}catch{}}return null}var q=Array.isArray,B=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},ae=[],A=-1;function z(t){return{current:t}}function W(t){0>A||(t.current=ae[A],ae[A]=null,A--)}function O(t,r){A++,ae[A]=t.current,t.current=r}var $=z(null),ee=z(null),re=z(null),Y=z(null);function le(t,r){switch(O(re,r),O(ee,t),O($,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?Ax(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=Ax(r),t=Ox(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}W($),O($,t)}function xe(){W($),W(ee),W(re)}function Te(t){t.memoizedState!==null&&O(Y,t);var r=$.current,a=Ox(r,t.type);r!==a&&(O(ee,t),O($,a))}function je(t){ee.current===t&&(W($),W(ee)),Y.current===t&&(W(Y),ts._currentValue=oe)}var He,fe;function Ce(t){if(He===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);He=r&&r[1]||"",fe=-1<a.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+He+t+fe}var Re=!1;function $e(t,r){if(!t||Re)return"";Re=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(r){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(se){var ie=se}Reflect.construct(t,[],pe)}else{try{pe.call()}catch(se){ie=se}t.call(pe.prototype)}}else{try{throw Error()}catch(se){ie=se}(pe=t())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(se){if(se&&ie&&typeof se.stack=="string")return[se.stack,ie.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=o.DetermineComponentFrameRoot(),S=g[0],E=g[1];if(S&&E){var F=S.split(`
44
- `),ne=E.split(`
45
- `);for(h=o=0;o<F.length&&!F[o].includes("DetermineComponentFrameRoot");)o++;for(;h<ne.length&&!ne[h].includes("DetermineComponentFrameRoot");)h++;if(o===F.length||h===ne.length)for(o=F.length-1,h=ne.length-1;1<=o&&0<=h&&F[o]!==ne[h];)h--;for(;1<=o&&0<=h;o--,h--)if(F[o]!==ne[h]){if(o!==1||h!==1)do if(o--,h--,0>h||F[o]!==ne[h]){var de=`
46
- `+F[o].replace(" at new "," at ");return t.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",t.displayName)),de}while(1<=o&&0<=h);break}}}finally{Re=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Ce(a):""}function Je(t,r){switch(t.tag){case 26:case 27:case 5:return Ce(t.type);case 16:return Ce("Lazy");case 13:return t.child!==r&&r!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return $e(t.type,!1);case 11:return $e(t.type.render,!1);case 1:return $e(t.type,!0);case 31:return Ce("Activity");default:return""}}function Ge(t){try{var r="",a=null;do r+=Je(t,a),a=t,t=t.return;while(t);return r}catch(o){return`
47
- Error generating stack: `+o.message+`
48
- `+o.stack}}var vt=Object.prototype.hasOwnProperty,Tt=e.unstable_scheduleCallback,Gt=e.unstable_cancelCallback,en=e.unstable_shouldYield,At=e.unstable_requestPaint,Ot=e.unstable_now,kn=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,ve=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,K=e.unstable_LowPriority,Se=e.unstable_IdlePriority,De=e.log,Xe=e.unstable_setDisableYieldValue,Qe=null,ue=null;function ge(t){if(typeof De=="function"&&Xe(t),ue&&typeof ue.setStrictMode=="function")try{ue.setStrictMode(Qe,t)}catch{}}var we=Math.clz32?Math.clz32:at,Le=Math.log,qe=Math.LN2;function at(t){return t>>>=0,t===0?32:31-(Le(t)/qe|0)|0}var qt=256,Bt=262144,Vt=4194304;function Jr(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function fi(t,r,a){var o=t.pendingLanes;if(o===0)return 0;var h=0,g=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var E=o&134217727;return E!==0?(o=E&~g,o!==0?h=Jr(o):(S&=E,S!==0?h=Jr(S):a||(a=E&~t,a!==0&&(h=Jr(a))))):(E=o&~g,E!==0?h=Jr(E):S!==0?h=Jr(S):a||(a=o&~t,a!==0&&(h=Jr(a)))),h===0?0:r!==0&&r!==h&&(r&g)===0&&(g=h&-h,a=r&-r,g>=a||g===32&&(a&4194048)!==0)?r:h}function pa(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function Y1(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function up(){var t=Vt;return Vt<<=1,(Vt&62914560)===0&&(Vt=4194304),t}function qc(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function ha(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function X1(t,r,a,o,h,g){var S=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var E=t.entanglements,F=t.expirationTimes,ne=t.hiddenUpdates;for(a=S&~a;0<a;){var de=31-we(a),pe=1<<de;E[de]=0,F[de]=-1;var ie=ne[de];if(ie!==null)for(ne[de]=null,de=0;de<ie.length;de++){var se=ie[de];se!==null&&(se.lane&=-536870913)}a&=~pe}o!==0&&dp(t,o,0),g!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=g&~(S&~r))}function dp(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var o=31-we(r);t.entangledLanes|=r,t.entanglements[o]=t.entanglements[o]|1073741824|a&261930}function fp(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var o=31-we(a),h=1<<o;h&r|t[o]&r&&(t[o]|=r),a&=~h}}function mp(t,r){var a=r&-r;return a=(a&42)!==0?1:Vc(a),(a&(t.suspendedLanes|r))!==0?0:a}function Vc(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Yc(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function pp(){var t=P.p;return t!==0?t:(t=window.event,t===void 0?32:Jx(t.type))}function hp(t,r){var a=P.p;try{return P.p=t,r()}finally{P.p=a}}var el=Math.random().toString(36).slice(2),un="__reactFiber$"+el,Tn="__reactProps$"+el,mi="__reactContainer$"+el,Xc="__reactEvents$"+el,P1="__reactListeners$"+el,Q1="__reactHandles$"+el,gp="__reactResources$"+el,ga="__reactMarker$"+el;function Pc(t){delete t[un],delete t[Tn],delete t[Xc],delete t[P1],delete t[Q1]}function pi(t){var r=t[un];if(r)return r;for(var a=t.parentNode;a;){if(r=a[mi]||a[un]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=Ix(t);t!==null;){if(a=t[un])return a;t=Ix(t)}return r}t=a,a=t.parentNode}return null}function hi(t){if(t=t[un]||t[mi]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function xa(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(i(33))}function gi(t){var r=t[gp];return r||(r=t[gp]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function sn(t){t[ga]=!0}var xp=new Set,bp={};function Ml(t,r){xi(t,r),xi(t+"Capture",r)}function xi(t,r){for(bp[t]=r,t=0;t<r.length;t++)xp.add(r[t])}var Z1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),yp={},vp={};function K1(t){return vt.call(vp,t)?!0:vt.call(yp,t)?!1:Z1.test(t)?vp[t]=!0:(yp[t]=!0,!1)}function Gs(t,r,a){if(K1(r))if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var o=r.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+a)}}function qs(t,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+a)}}function Er(t,r,a,o){if(o===null)t.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(r,a,""+o)}}function Wn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Sp(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function W1(t,r,a){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,g=o.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return h.call(this)},set:function(S){a=""+S,g.call(this,S)}}),Object.defineProperty(t,r,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(S){a=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Qc(t){if(!t._valueTracker){var r=Sp(t)?"checked":"value";t._valueTracker=W1(t,r,""+t[r])}}function wp(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),o="";return t&&(o=Sp(t)?t.checked?"true":"false":t.value),t=o,t!==a?(r.setValue(t),!0):!1}function Vs(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var J1=/[\n"\\]/g;function Jn(t){return t.replace(J1,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Zc(t,r,a,o,h,g,S,E){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),r!=null?S==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Wn(r)):t.value!==""+Wn(r)&&(t.value=""+Wn(r)):S!=="submit"&&S!=="reset"||t.removeAttribute("value"),r!=null?Kc(t,S,Wn(r)):a!=null?Kc(t,S,Wn(a)):o!=null&&t.removeAttribute("value"),h==null&&g!=null&&(t.defaultChecked=!!g),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.name=""+Wn(E):t.removeAttribute("name")}function kp(t,r,a,o,h,g,S,E){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.type=g),r!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||r!=null)){Qc(t);return}a=a!=null?""+Wn(a):"",r=r!=null?""+Wn(r):a,E||r===t.value||(t.value=r),t.defaultValue=r}o=o??h,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=E?t.checked:!!o,t.defaultChecked=!!o,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),Qc(t)}function Kc(t,r,a){r==="number"&&Vs(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function bi(t,r,a,o){if(t=t.options,r){r={};for(var h=0;h<a.length;h++)r["$"+a[h]]=!0;for(a=0;a<t.length;a++)h=r.hasOwnProperty("$"+t[a].value),t[a].selected!==h&&(t[a].selected=h),h&&o&&(t[a].defaultSelected=!0)}else{for(a=""+Wn(a),r=null,h=0;h<t.length;h++){if(t[h].value===a){t[h].selected=!0,o&&(t[h].defaultSelected=!0);return}r!==null||t[h].disabled||(r=t[h])}r!==null&&(r.selected=!0)}}function jp(t,r,a){if(r!=null&&(r=""+Wn(r),r!==t.value&&(t.value=r),a==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=a!=null?""+Wn(a):""}function Np(t,r,a,o){if(r==null){if(o!=null){if(a!=null)throw Error(i(92));if(q(o)){if(1<o.length)throw Error(i(93));o=o[0]}a=o}a==null&&(a=""),r=a}a=Wn(r),t.defaultValue=a,o=t.textContent,o===a&&o!==""&&o!==null&&(t.value=o),Qc(t)}function yi(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var eS=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Cp(t,r,a){var o=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":o?t.setProperty(r,a):typeof a!="number"||a===0||eS.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function Ep(t,r,a){if(r!=null&&typeof r!="object")throw Error(i(62));if(t=t.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||r!=null&&r.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var h in r)o=r[h],r.hasOwnProperty(h)&&a[h]!==o&&Cp(t,h,o)}else for(var g in r)r.hasOwnProperty(g)&&Cp(t,g,r[g])}function Wc(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tS=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),nS=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ys(t){return nS.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Tr(){}var Jc=null;function eu(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var vi=null,Si=null;function Tp(t){var r=hi(t);if(r&&(t=r.stateNode)){var a=t[Tn]||null;e:switch(t=r.stateNode,r.type){case"input":if(Zc(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Jn(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var o=a[r];if(o!==t&&o.form===t.form){var h=o[Tn]||null;if(!h)throw Error(i(90));Zc(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(r=0;r<a.length;r++)o=a[r],o.form===t.form&&wp(o)}break e;case"textarea":jp(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&bi(t,!!a.multiple,r,!1)}}}var tu=!1;function Ap(t,r,a){if(tu)return t(r,a);tu=!0;try{var o=t(r);return o}finally{if(tu=!1,(vi!==null||Si!==null)&&(zo(),vi&&(r=vi,t=Si,Si=vi=null,Tp(r),t)))for(r=0;r<t.length;r++)Tp(t[r])}}function ba(t,r){var a=t.stateNode;if(a===null)return null;var o=a[Tn]||null;if(o===null)return null;a=o[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(i(231,r,typeof a));return a}var Ar=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nu=!1;if(Ar)try{var ya={};Object.defineProperty(ya,"passive",{get:function(){nu=!0}}),window.addEventListener("test",ya,ya),window.removeEventListener("test",ya,ya)}catch{nu=!1}var tl=null,ru=null,Xs=null;function Op(){if(Xs)return Xs;var t,r=ru,a=r.length,o,h="value"in tl?tl.value:tl.textContent,g=h.length;for(t=0;t<a&&r[t]===h[t];t++);var S=a-t;for(o=1;o<=S&&r[a-o]===h[g-o];o++);return Xs=h.slice(t,1<o?1-o:void 0)}function Ps(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Qs(){return!0}function _p(){return!1}function An(t){function r(a,o,h,g,S){this._reactName=a,this._targetInst=h,this.type=o,this.nativeEvent=g,this.target=S,this.currentTarget=null;for(var E in t)t.hasOwnProperty(E)&&(a=t[E],this[E]=a?a(g):g[E]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Qs:_p,this.isPropagationStopped=_p,this}return b(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Qs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Qs)},persist:function(){},isPersistent:Qs}),r}var zl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zs=An(zl),va=b({},zl,{view:0,detail:0}),rS=An(va),lu,iu,Sa,Ks=b({},va,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:su,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Sa&&(Sa&&t.type==="mousemove"?(lu=t.screenX-Sa.screenX,iu=t.screenY-Sa.screenY):iu=lu=0,Sa=t),lu)},movementY:function(t){return"movementY"in t?t.movementY:iu}}),Rp=An(Ks),lS=b({},Ks,{dataTransfer:0}),iS=An(lS),aS=b({},va,{relatedTarget:0}),au=An(aS),sS=b({},zl,{animationName:0,elapsedTime:0,pseudoElement:0}),oS=An(sS),cS=b({},zl,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),uS=An(cS),dS=b({},zl,{data:0}),Mp=An(dS),fS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},pS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hS(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=pS[t])?!!r[t]:!1}function su(){return hS}var gS=b({},va,{key:function(t){if(t.key){var r=fS[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Ps(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?mS[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:su,charCode:function(t){return t.type==="keypress"?Ps(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ps(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),xS=An(gS),bS=b({},Ks,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zp=An(bS),yS=b({},va,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:su}),vS=An(yS),SS=b({},zl,{propertyName:0,elapsedTime:0,pseudoElement:0}),wS=An(SS),kS=b({},Ks,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),jS=An(kS),NS=b({},zl,{newState:0,oldState:0}),CS=An(NS),ES=[9,13,27,32],ou=Ar&&"CompositionEvent"in window,wa=null;Ar&&"documentMode"in document&&(wa=document.documentMode);var TS=Ar&&"TextEvent"in window&&!wa,Dp=Ar&&(!ou||wa&&8<wa&&11>=wa),Lp=" ",Ip=!1;function Bp(t,r){switch(t){case"keyup":return ES.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hp(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var wi=!1;function AS(t,r){switch(t){case"compositionend":return Hp(r);case"keypress":return r.which!==32?null:(Ip=!0,Lp);case"textInput":return t=r.data,t===Lp&&Ip?null:t;default:return null}}function OS(t,r){if(wi)return t==="compositionend"||!ou&&Bp(t,r)?(t=Op(),Xs=ru=tl=null,wi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Dp&&r.locale!=="ko"?null:r.data;default:return null}}var _S={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Up(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!_S[t.type]:r==="textarea"}function Fp(t,r,a,o){vi?Si?Si.push(o):Si=[o]:vi=o,r=Fo(r,"onChange"),0<r.length&&(a=new Zs("onChange","change",null,a,o),t.push({event:a,listeners:r}))}var ka=null,ja=null;function RS(t){kx(t,0)}function Ws(t){var r=xa(t);if(wp(r))return t}function $p(t,r){if(t==="change")return r}var Gp=!1;if(Ar){var cu;if(Ar){var uu="oninput"in document;if(!uu){var qp=document.createElement("div");qp.setAttribute("oninput","return;"),uu=typeof qp.oninput=="function"}cu=uu}else cu=!1;Gp=cu&&(!document.documentMode||9<document.documentMode)}function Vp(){ka&&(ka.detachEvent("onpropertychange",Yp),ja=ka=null)}function Yp(t){if(t.propertyName==="value"&&Ws(ja)){var r=[];Fp(r,ja,t,eu(t)),Ap(RS,r)}}function MS(t,r,a){t==="focusin"?(Vp(),ka=r,ja=a,ka.attachEvent("onpropertychange",Yp)):t==="focusout"&&Vp()}function zS(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ws(ja)}function DS(t,r){if(t==="click")return Ws(r)}function LS(t,r){if(t==="input"||t==="change")return Ws(r)}function IS(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var Hn=typeof Object.is=="function"?Object.is:IS;function Na(t,r){if(Hn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var a=Object.keys(t),o=Object.keys(r);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var h=a[o];if(!vt.call(r,h)||!Hn(t[h],r[h]))return!1}return!0}function Xp(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Pp(t,r){var a=Xp(t);t=0;for(var o;a;){if(a.nodeType===3){if(o=t+a.textContent.length,t<=r&&o>=r)return{node:a,offset:r-t};t=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Xp(a)}}function Qp(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Qp(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Zp(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Vs(t.document);r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=Vs(t.document)}return r}function du(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var BS=Ar&&"documentMode"in document&&11>=document.documentMode,ki=null,fu=null,Ca=null,mu=!1;function Kp(t,r,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;mu||ki==null||ki!==Vs(o)||(o=ki,"selectionStart"in o&&du(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Ca&&Na(Ca,o)||(Ca=o,o=Fo(fu,"onSelect"),0<o.length&&(r=new Zs("onSelect","select",null,r,a),t.push({event:r,listeners:o}),r.target=ki)))}function Dl(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var ji={animationend:Dl("Animation","AnimationEnd"),animationiteration:Dl("Animation","AnimationIteration"),animationstart:Dl("Animation","AnimationStart"),transitionrun:Dl("Transition","TransitionRun"),transitionstart:Dl("Transition","TransitionStart"),transitioncancel:Dl("Transition","TransitionCancel"),transitionend:Dl("Transition","TransitionEnd")},pu={},Wp={};Ar&&(Wp=document.createElement("div").style,"AnimationEvent"in window||(delete ji.animationend.animation,delete ji.animationiteration.animation,delete ji.animationstart.animation),"TransitionEvent"in window||delete ji.transitionend.transition);function Ll(t){if(pu[t])return pu[t];if(!ji[t])return t;var r=ji[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in Wp)return pu[t]=r[a];return t}var Jp=Ll("animationend"),eh=Ll("animationiteration"),th=Ll("animationstart"),HS=Ll("transitionrun"),US=Ll("transitionstart"),FS=Ll("transitioncancel"),nh=Ll("transitionend"),rh=new Map,hu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");hu.push("scrollEnd");function dr(t,r){rh.set(t,r),Ml(r,[t])}var Js=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},er=[],Ni=0,gu=0;function eo(){for(var t=Ni,r=gu=Ni=0;r<t;){var a=er[r];er[r++]=null;var o=er[r];er[r++]=null;var h=er[r];er[r++]=null;var g=er[r];if(er[r++]=null,o!==null&&h!==null){var S=o.pending;S===null?h.next=h:(h.next=S.next,S.next=h),o.pending=h}g!==0&&lh(a,h,g)}}function to(t,r,a,o){er[Ni++]=t,er[Ni++]=r,er[Ni++]=a,er[Ni++]=o,gu|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function xu(t,r,a,o){return to(t,r,a,o),no(t)}function Il(t,r){return to(t,null,null,r),no(t)}function lh(t,r,a){t.lanes|=a;var o=t.alternate;o!==null&&(o.lanes|=a);for(var h=!1,g=t.return;g!==null;)g.childLanes|=a,o=g.alternate,o!==null&&(o.childLanes|=a),g.tag===22&&(t=g.stateNode,t===null||t._visibility&1||(h=!0)),t=g,g=g.return;return t.tag===3?(g=t.stateNode,h&&r!==null&&(h=31-we(a),t=g.hiddenUpdates,o=t[h],o===null?t[h]=[r]:o.push(r),r.lane=a|536870912),g):null}function no(t){if(50<Pa)throw Pa=0,Cd=null,Error(i(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Ci={};function $S(t,r,a,o){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Un(t,r,a,o){return new $S(t,r,a,o)}function bu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Or(t,r){var a=t.alternate;return a===null?(a=Un(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function ih(t,r){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,r=a.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function ro(t,r,a,o,h,g){var S=0;if(o=t,typeof t=="function")bu(t)&&(S=1);else if(typeof t=="string")S=X2(t,a,$.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case U:return t=Un(31,a,r,h),t.elementType=U,t.lanes=g,t;case N:return Bl(a.children,h,g,r);case j:S=8,h|=24;break;case k:return t=Un(12,a,r,h|2),t.elementType=k,t.lanes=g,t;case G:return t=Un(13,a,r,h),t.elementType=G,t.lanes=g,t;case I:return t=Un(19,a,r,h),t.elementType=I,t.lanes=g,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case C:S=10;break e;case T:S=9;break e;case L:S=11;break e;case R:S=14;break e;case X:S=16,o=null;break e}S=29,a=Error(i(130,t===null?"null":typeof t,"")),o=null}return r=Un(S,a,r,h),r.elementType=t,r.type=o,r.lanes=g,r}function Bl(t,r,a,o){return t=Un(7,t,o,r),t.lanes=a,t}function yu(t,r,a){return t=Un(6,t,null,r),t.lanes=a,t}function ah(t){var r=Un(18,null,null,0);return r.stateNode=t,r}function vu(t,r,a){return r=Un(4,t.children!==null?t.children:[],t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var sh=new WeakMap;function tr(t,r){if(typeof t=="object"&&t!==null){var a=sh.get(t);return a!==void 0?a:(r={value:t,source:r,stack:Ge(r)},sh.set(t,r),r)}return{value:t,source:r,stack:Ge(r)}}var Ei=[],Ti=0,lo=null,Ea=0,nr=[],rr=0,nl=null,br=1,yr="";function _r(t,r){Ei[Ti++]=Ea,Ei[Ti++]=lo,lo=t,Ea=r}function oh(t,r,a){nr[rr++]=br,nr[rr++]=yr,nr[rr++]=nl,nl=t;var o=br;t=yr;var h=32-we(o)-1;o&=~(1<<h),a+=1;var g=32-we(r)+h;if(30<g){var S=h-h%5;g=(o&(1<<S)-1).toString(32),o>>=S,h-=S,br=1<<32-we(r)+h|a<<h|o,yr=g+t}else br=1<<g|a<<h|o,yr=t}function Su(t){t.return!==null&&(_r(t,1),oh(t,1,0))}function wu(t){for(;t===lo;)lo=Ei[--Ti],Ei[Ti]=null,Ea=Ei[--Ti],Ei[Ti]=null;for(;t===nl;)nl=nr[--rr],nr[rr]=null,yr=nr[--rr],nr[rr]=null,br=nr[--rr],nr[rr]=null}function ch(t,r){nr[rr++]=br,nr[rr++]=yr,nr[rr++]=nl,br=r.id,yr=r.overflow,nl=t}var dn=null,_t=null,st=!1,rl=null,lr=!1,ku=Error(i(519));function ll(t){var r=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ta(tr(r,t)),ku}function uh(t){var r=t.stateNode,a=t.type,o=t.memoizedProps;switch(r[un]=t,r[Tn]=o,a){case"dialog":nt("cancel",r),nt("close",r);break;case"iframe":case"object":case"embed":nt("load",r);break;case"video":case"audio":for(a=0;a<Za.length;a++)nt(Za[a],r);break;case"source":nt("error",r);break;case"img":case"image":case"link":nt("error",r),nt("load",r);break;case"details":nt("toggle",r);break;case"input":nt("invalid",r),kp(r,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":nt("invalid",r);break;case"textarea":nt("invalid",r),Np(r,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||o.suppressHydrationWarning===!0||Ex(r.textContent,a)?(o.popover!=null&&(nt("beforetoggle",r),nt("toggle",r)),o.onScroll!=null&&nt("scroll",r),o.onScrollEnd!=null&&nt("scrollend",r),o.onClick!=null&&(r.onclick=Tr),r=!0):r=!1,r||ll(t,!0)}function dh(t){for(dn=t.return;dn;)switch(dn.tag){case 5:case 31:case 13:lr=!1;return;case 27:case 3:lr=!0;return;default:dn=dn.return}}function Ai(t){if(t!==dn)return!1;if(!st)return dh(t),st=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Fd(t.type,t.memoizedProps)),a=!a),a&&_t&&ll(t),dh(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));_t=Lx(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));_t=Lx(t)}else r===27?(r=_t,bl(t.type)?(t=Yd,Yd=null,_t=t):_t=r):_t=dn?ar(t.stateNode.nextSibling):null;return!0}function Hl(){_t=dn=null,st=!1}function ju(){var t=rl;return t!==null&&(Mn===null?Mn=t:Mn.push.apply(Mn,t),rl=null),t}function Ta(t){rl===null?rl=[t]:rl.push(t)}var Nu=z(null),Ul=null,Rr=null;function il(t,r,a){O(Nu,r._currentValue),r._currentValue=a}function Mr(t){t._currentValue=Nu.current,W(Nu)}function Cu(t,r,a){for(;t!==null;){var o=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,o!==null&&(o.childLanes|=r)):o!==null&&(o.childLanes&r)!==r&&(o.childLanes|=r),t===a)break;t=t.return}}function Eu(t,r,a,o){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var g=h.dependencies;if(g!==null){var S=h.child;g=g.firstContext;e:for(;g!==null;){var E=g;g=h;for(var F=0;F<r.length;F++)if(E.context===r[F]){g.lanes|=a,E=g.alternate,E!==null&&(E.lanes|=a),Cu(g.return,a,t),o||(S=null);break e}g=E.next}}else if(h.tag===18){if(S=h.return,S===null)throw Error(i(341));S.lanes|=a,g=S.alternate,g!==null&&(g.lanes|=a),Cu(S,a,t),S=null}else S=h.child;if(S!==null)S.return=h;else for(S=h;S!==null;){if(S===t){S=null;break}if(h=S.sibling,h!==null){h.return=S.return,S=h;break}S=S.return}h=S}}function Oi(t,r,a,o){t=null;for(var h=r,g=!1;h!==null;){if(!g){if((h.flags&524288)!==0)g=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var S=h.alternate;if(S===null)throw Error(i(387));if(S=S.memoizedProps,S!==null){var E=h.type;Hn(h.pendingProps.value,S.value)||(t!==null?t.push(E):t=[E])}}else if(h===Y.current){if(S=h.alternate,S===null)throw Error(i(387));S.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(ts):t=[ts])}h=h.return}t!==null&&Eu(r,t,a,o),r.flags|=262144}function io(t){for(t=t.firstContext;t!==null;){if(!Hn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Fl(t){Ul=t,Rr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function fn(t){return fh(Ul,t)}function ao(t,r){return Ul===null&&Fl(t),fh(t,r)}function fh(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},Rr===null){if(t===null)throw Error(i(308));Rr=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else Rr=Rr.next=r;return a}var GS=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(a,o){t.push(o)}};this.abort=function(){r.aborted=!0,t.forEach(function(a){return a()})}},qS=e.unstable_scheduleCallback,VS=e.unstable_NormalPriority,Yt={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Tu(){return{controller:new GS,data:new Map,refCount:0}}function Aa(t){t.refCount--,t.refCount===0&&qS(VS,function(){t.controller.abort()})}var Oa=null,Au=0,_i=0,Ri=null;function YS(t,r){if(Oa===null){var a=Oa=[];Au=0,_i=Rd(),Ri={status:"pending",value:void 0,then:function(o){a.push(o)}}}return Au++,r.then(mh,mh),r}function mh(){if(--Au===0&&Oa!==null){Ri!==null&&(Ri.status="fulfilled");var t=Oa;Oa=null,_i=0,Ri=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function XS(t,r){var a=[],o={status:"pending",value:null,reason:null,then:function(h){a.push(h)}};return t.then(function(){o.status="fulfilled",o.value=r;for(var h=0;h<a.length;h++)(0,a[h])(r)},function(h){for(o.status="rejected",o.reason=h,h=0;h<a.length;h++)(0,a[h])(void 0)}),o}var ph=B.S;B.S=function(t,r){Kg=Ot(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&YS(t,r),ph!==null&&ph(t,r)};var $l=z(null);function Ou(){var t=$l.current;return t!==null?t:Nt.pooledCache}function so(t,r){r===null?O($l,$l.current):O($l,r.pool)}function hh(){var t=Ou();return t===null?null:{parent:Yt._currentValue,pool:t}}var Mi=Error(i(460)),_u=Error(i(474)),oo=Error(i(542)),co={then:function(){}};function gh(t){return t=t.status,t==="fulfilled"||t==="rejected"}function xh(t,r,a){switch(a=t[a],a===void 0?t.push(r):a!==r&&(r.then(Tr,Tr),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,yh(t),t;default:if(typeof r.status=="string")r.then(Tr,Tr);else{if(t=Nt,t!==null&&100<t.shellSuspendCounter)throw Error(i(482));t=r,t.status="pending",t.then(function(o){if(r.status==="pending"){var h=r;h.status="fulfilled",h.value=o}},function(o){if(r.status==="pending"){var h=r;h.status="rejected",h.reason=o}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,yh(t),t}throw ql=r,Mi}}function Gl(t){try{var r=t._init;return r(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ql=a,Mi):a}}var ql=null;function bh(){if(ql===null)throw Error(i(459));var t=ql;return ql=null,t}function yh(t){if(t===Mi||t===oo)throw Error(i(483))}var zi=null,_a=0;function uo(t){var r=_a;return _a+=1,zi===null&&(zi=[]),xh(zi,t,r)}function Ra(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function fo(t,r){throw r.$$typeof===y?Error(i(525)):(t=Object.prototype.toString.call(r),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function vh(t){function r(J,Z){if(t){var te=J.deletions;te===null?(J.deletions=[Z],J.flags|=16):te.push(Z)}}function a(J,Z){if(!t)return null;for(;Z!==null;)r(J,Z),Z=Z.sibling;return null}function o(J){for(var Z=new Map;J!==null;)J.key!==null?Z.set(J.key,J):Z.set(J.index,J),J=J.sibling;return Z}function h(J,Z){return J=Or(J,Z),J.index=0,J.sibling=null,J}function g(J,Z,te){return J.index=te,t?(te=J.alternate,te!==null?(te=te.index,te<Z?(J.flags|=67108866,Z):te):(J.flags|=67108866,Z)):(J.flags|=1048576,Z)}function S(J){return t&&J.alternate===null&&(J.flags|=67108866),J}function E(J,Z,te,me){return Z===null||Z.tag!==6?(Z=yu(te,J.mode,me),Z.return=J,Z):(Z=h(Z,te),Z.return=J,Z)}function F(J,Z,te,me){var ze=te.type;return ze===N?de(J,Z,te.props.children,me,te.key):Z!==null&&(Z.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===X&&Gl(ze)===Z.type)?(Z=h(Z,te.props),Ra(Z,te),Z.return=J,Z):(Z=ro(te.type,te.key,te.props,null,J.mode,me),Ra(Z,te),Z.return=J,Z)}function ne(J,Z,te,me){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==te.containerInfo||Z.stateNode.implementation!==te.implementation?(Z=vu(te,J.mode,me),Z.return=J,Z):(Z=h(Z,te.children||[]),Z.return=J,Z)}function de(J,Z,te,me,ze){return Z===null||Z.tag!==7?(Z=Bl(te,J.mode,me,ze),Z.return=J,Z):(Z=h(Z,te),Z.return=J,Z)}function pe(J,Z,te){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=yu(""+Z,J.mode,te),Z.return=J,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:return te=ro(Z.type,Z.key,Z.props,null,J.mode,te),Ra(te,Z),te.return=J,te;case w:return Z=vu(Z,J.mode,te),Z.return=J,Z;case X:return Z=Gl(Z),pe(J,Z,te)}if(q(Z)||M(Z))return Z=Bl(Z,J.mode,te,null),Z.return=J,Z;if(typeof Z.then=="function")return pe(J,uo(Z),te);if(Z.$$typeof===C)return pe(J,ao(J,Z),te);fo(J,Z)}return null}function ie(J,Z,te,me){var ze=Z!==null?Z.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return ze!==null?null:E(J,Z,""+te,me);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return te.key===ze?F(J,Z,te,me):null;case w:return te.key===ze?ne(J,Z,te,me):null;case X:return te=Gl(te),ie(J,Z,te,me)}if(q(te)||M(te))return ze!==null?null:de(J,Z,te,me,null);if(typeof te.then=="function")return ie(J,Z,uo(te),me);if(te.$$typeof===C)return ie(J,Z,ao(J,te),me);fo(J,te)}return null}function se(J,Z,te,me,ze){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return J=J.get(te)||null,E(Z,J,""+me,ze);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case v:return J=J.get(me.key===null?te:me.key)||null,F(Z,J,me,ze);case w:return J=J.get(me.key===null?te:me.key)||null,ne(Z,J,me,ze);case X:return me=Gl(me),se(J,Z,te,me,ze)}if(q(me)||M(me))return J=J.get(te)||null,de(Z,J,me,ze,null);if(typeof me.then=="function")return se(J,Z,te,uo(me),ze);if(me.$$typeof===C)return se(J,Z,te,ao(Z,me),ze);fo(Z,me)}return null}function Ee(J,Z,te,me){for(var ze=null,dt=null,Oe=Z,Ze=Z=0,it=null;Oe!==null&&Ze<te.length;Ze++){Oe.index>Ze?(it=Oe,Oe=null):it=Oe.sibling;var ft=ie(J,Oe,te[Ze],me);if(ft===null){Oe===null&&(Oe=it);break}t&&Oe&&ft.alternate===null&&r(J,Oe),Z=g(ft,Z,Ze),dt===null?ze=ft:dt.sibling=ft,dt=ft,Oe=it}if(Ze===te.length)return a(J,Oe),st&&_r(J,Ze),ze;if(Oe===null){for(;Ze<te.length;Ze++)Oe=pe(J,te[Ze],me),Oe!==null&&(Z=g(Oe,Z,Ze),dt===null?ze=Oe:dt.sibling=Oe,dt=Oe);return st&&_r(J,Ze),ze}for(Oe=o(Oe);Ze<te.length;Ze++)it=se(Oe,J,Ze,te[Ze],me),it!==null&&(t&&it.alternate!==null&&Oe.delete(it.key===null?Ze:it.key),Z=g(it,Z,Ze),dt===null?ze=it:dt.sibling=it,dt=it);return t&&Oe.forEach(function(kl){return r(J,kl)}),st&&_r(J,Ze),ze}function Be(J,Z,te,me){if(te==null)throw Error(i(151));for(var ze=null,dt=null,Oe=Z,Ze=Z=0,it=null,ft=te.next();Oe!==null&&!ft.done;Ze++,ft=te.next()){Oe.index>Ze?(it=Oe,Oe=null):it=Oe.sibling;var kl=ie(J,Oe,ft.value,me);if(kl===null){Oe===null&&(Oe=it);break}t&&Oe&&kl.alternate===null&&r(J,Oe),Z=g(kl,Z,Ze),dt===null?ze=kl:dt.sibling=kl,dt=kl,Oe=it}if(ft.done)return a(J,Oe),st&&_r(J,Ze),ze;if(Oe===null){for(;!ft.done;Ze++,ft=te.next())ft=pe(J,ft.value,me),ft!==null&&(Z=g(ft,Z,Ze),dt===null?ze=ft:dt.sibling=ft,dt=ft);return st&&_r(J,Ze),ze}for(Oe=o(Oe);!ft.done;Ze++,ft=te.next())ft=se(Oe,J,Ze,ft.value,me),ft!==null&&(t&&ft.alternate!==null&&Oe.delete(ft.key===null?Ze:ft.key),Z=g(ft,Z,Ze),dt===null?ze=ft:dt.sibling=ft,dt=ft);return t&&Oe.forEach(function(lw){return r(J,lw)}),st&&_r(J,Ze),ze}function kt(J,Z,te,me){if(typeof te=="object"&&te!==null&&te.type===N&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case v:e:{for(var ze=te.key;Z!==null;){if(Z.key===ze){if(ze=te.type,ze===N){if(Z.tag===7){a(J,Z.sibling),me=h(Z,te.props.children),me.return=J,J=me;break e}}else if(Z.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===X&&Gl(ze)===Z.type){a(J,Z.sibling),me=h(Z,te.props),Ra(me,te),me.return=J,J=me;break e}a(J,Z);break}else r(J,Z);Z=Z.sibling}te.type===N?(me=Bl(te.props.children,J.mode,me,te.key),me.return=J,J=me):(me=ro(te.type,te.key,te.props,null,J.mode,me),Ra(me,te),me.return=J,J=me)}return S(J);case w:e:{for(ze=te.key;Z!==null;){if(Z.key===ze)if(Z.tag===4&&Z.stateNode.containerInfo===te.containerInfo&&Z.stateNode.implementation===te.implementation){a(J,Z.sibling),me=h(Z,te.children||[]),me.return=J,J=me;break e}else{a(J,Z);break}else r(J,Z);Z=Z.sibling}me=vu(te,J.mode,me),me.return=J,J=me}return S(J);case X:return te=Gl(te),kt(J,Z,te,me)}if(q(te))return Ee(J,Z,te,me);if(M(te)){if(ze=M(te),typeof ze!="function")throw Error(i(150));return te=ze.call(te),Be(J,Z,te,me)}if(typeof te.then=="function")return kt(J,Z,uo(te),me);if(te.$$typeof===C)return kt(J,Z,ao(J,te),me);fo(J,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,Z!==null&&Z.tag===6?(a(J,Z.sibling),me=h(Z,te),me.return=J,J=me):(a(J,Z),me=yu(te,J.mode,me),me.return=J,J=me),S(J)):a(J,Z)}return function(J,Z,te,me){try{_a=0;var ze=kt(J,Z,te,me);return zi=null,ze}catch(Oe){if(Oe===Mi||Oe===oo)throw Oe;var dt=Un(29,Oe,null,J.mode);return dt.lanes=me,dt.return=J,dt}finally{}}}var Vl=vh(!0),Sh=vh(!1),al=!1;function Ru(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mu(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function sl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ol(t,r,a){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(pt&2)!==0){var h=o.pending;return h===null?r.next=r:(r.next=h.next,h.next=r),o.pending=r,r=no(t),lh(t,null,a),r}return to(t,o,r,a),no(t)}function Ma(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var o=r.lanes;o&=t.pendingLanes,a|=o,r.lanes=a,fp(t,a)}}function zu(t,r){var a=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var h=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?h=g=S:g=g.next=S,a=a.next}while(a!==null);g===null?h=g=r:g=g.next=r}else h=g=r;a={baseState:o.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:o.shared,callbacks:o.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}var Du=!1;function za(){if(Du){var t=Ri;if(t!==null)throw t}}function Da(t,r,a,o){Du=!1;var h=t.updateQueue;al=!1;var g=h.firstBaseUpdate,S=h.lastBaseUpdate,E=h.shared.pending;if(E!==null){h.shared.pending=null;var F=E,ne=F.next;F.next=null,S===null?g=ne:S.next=ne,S=F;var de=t.alternate;de!==null&&(de=de.updateQueue,E=de.lastBaseUpdate,E!==S&&(E===null?de.firstBaseUpdate=ne:E.next=ne,de.lastBaseUpdate=F))}if(g!==null){var pe=h.baseState;S=0,de=ne=F=null,E=g;do{var ie=E.lane&-536870913,se=ie!==E.lane;if(se?(lt&ie)===ie:(o&ie)===ie){ie!==0&&ie===_i&&(Du=!0),de!==null&&(de=de.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var Ee=t,Be=E;ie=r;var kt=a;switch(Be.tag){case 1:if(Ee=Be.payload,typeof Ee=="function"){pe=Ee.call(kt,pe,ie);break e}pe=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Be.payload,ie=typeof Ee=="function"?Ee.call(kt,pe,ie):Ee,ie==null)break e;pe=b({},pe,ie);break e;case 2:al=!0}}ie=E.callback,ie!==null&&(t.flags|=64,se&&(t.flags|=8192),se=h.callbacks,se===null?h.callbacks=[ie]:se.push(ie))}else se={lane:ie,tag:E.tag,payload:E.payload,callback:E.callback,next:null},de===null?(ne=de=se,F=pe):de=de.next=se,S|=ie;if(E=E.next,E===null){if(E=h.shared.pending,E===null)break;se=E,E=se.next,se.next=null,h.lastBaseUpdate=se,h.shared.pending=null}}while(!0);de===null&&(F=pe),h.baseState=F,h.firstBaseUpdate=ne,h.lastBaseUpdate=de,g===null&&(h.shared.lanes=0),ml|=S,t.lanes=S,t.memoizedState=pe}}function wh(t,r){if(typeof t!="function")throw Error(i(191,t));t.call(r)}function kh(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)wh(a[t],r)}var Di=z(null),mo=z(0);function jh(t,r){t=$r,O(mo,t),O(Di,r),$r=t|r.baseLanes}function Lu(){O(mo,$r),O(Di,Di.current)}function Iu(){$r=mo.current,W(Di),W(mo)}var Fn=z(null),ir=null;function cl(t){var r=t.alternate;O(Ft,Ft.current&1),O(Fn,t),ir===null&&(r===null||Di.current!==null||r.memoizedState!==null)&&(ir=t)}function Bu(t){O(Ft,Ft.current),O(Fn,t),ir===null&&(ir=t)}function Nh(t){t.tag===22?(O(Ft,Ft.current),O(Fn,t),ir===null&&(ir=t)):ul()}function ul(){O(Ft,Ft.current),O(Fn,Fn.current)}function $n(t){W(Fn),ir===t&&(ir=null),W(Ft)}var Ft=z(0);function po(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||qd(a)||Vd(a)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var zr=0,Pe=null,St=null,Xt=null,ho=!1,Li=!1,Yl=!1,go=0,La=0,Ii=null,PS=0;function Ht(){throw Error(i(321))}function Hu(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!Hn(t[a],r[a]))return!1;return!0}function Uu(t,r,a,o,h,g){return zr=g,Pe=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,B.H=t===null||t.memoizedState===null?og:td,Yl=!1,g=a(o,h),Yl=!1,Li&&(g=Eh(r,a,o,h)),Ch(t),g}function Ch(t){B.H=Ha;var r=St!==null&&St.next!==null;if(zr=0,Xt=St=Pe=null,ho=!1,La=0,Ii=null,r)throw Error(i(300));t===null||Pt||(t=t.dependencies,t!==null&&io(t)&&(Pt=!0))}function Eh(t,r,a,o){Pe=t;var h=0;do{if(Li&&(Ii=null),La=0,Li=!1,25<=h)throw Error(i(301));if(h+=1,Xt=St=null,t.updateQueue!=null){var g=t.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}B.H=cg,g=r(a,o)}while(Li);return g}function QS(){var t=B.H,r=t.useState()[0];return r=typeof r.then=="function"?Ia(r):r,t=t.useState()[0],(St!==null?St.memoizedState:null)!==t&&(Pe.flags|=1024),r}function Fu(){var t=go!==0;return go=0,t}function $u(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function Gu(t){if(ho){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}ho=!1}zr=0,Xt=St=Pe=null,Li=!1,La=go=0,Ii=null}function jn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Pe.memoizedState=Xt=t:Xt=Xt.next=t,Xt}function $t(){if(St===null){var t=Pe.alternate;t=t!==null?t.memoizedState:null}else t=St.next;var r=Xt===null?Pe.memoizedState:Xt.next;if(r!==null)Xt=r,St=t;else{if(t===null)throw Pe.alternate===null?Error(i(467)):Error(i(310));St=t,t={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},Xt===null?Pe.memoizedState=Xt=t:Xt=Xt.next=t}return Xt}function xo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ia(t){var r=La;return La+=1,Ii===null&&(Ii=[]),t=xh(Ii,t,r),r=Pe,(Xt===null?r.memoizedState:Xt.next)===null&&(r=r.alternate,B.H=r===null||r.memoizedState===null?og:td),t}function bo(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ia(t);if(t.$$typeof===C)return fn(t)}throw Error(i(438,String(t)))}function qu(t){var r=null,a=Pe.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var o=Pe.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(r={data:o.data.map(function(h){return h.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=xo(),Pe.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(t),o=0;o<t;o++)a[o]=D;return r.index++,a}function Dr(t,r){return typeof r=="function"?r(t):r}function yo(t){var r=$t();return Vu(r,St,t)}function Vu(t,r,a){var o=t.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=a;var h=t.baseQueue,g=o.pending;if(g!==null){if(h!==null){var S=h.next;h.next=g.next,g.next=S}r.baseQueue=h=g,o.pending=null}if(g=t.baseState,h===null)t.memoizedState=g;else{r=h.next;var E=S=null,F=null,ne=r,de=!1;do{var pe=ne.lane&-536870913;if(pe!==ne.lane?(lt&pe)===pe:(zr&pe)===pe){var ie=ne.revertLane;if(ie===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),pe===_i&&(de=!0);else if((zr&ie)===ie){ne=ne.next,ie===_i&&(de=!0);continue}else pe={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},F===null?(E=F=pe,S=g):F=F.next=pe,Pe.lanes|=ie,ml|=ie;pe=ne.action,Yl&&a(g,pe),g=ne.hasEagerState?ne.eagerState:a(g,pe)}else ie={lane:pe,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},F===null?(E=F=ie,S=g):F=F.next=ie,Pe.lanes|=pe,ml|=pe;ne=ne.next}while(ne!==null&&ne!==r);if(F===null?S=g:F.next=E,!Hn(g,t.memoizedState)&&(Pt=!0,de&&(a=Ri,a!==null)))throw a;t.memoizedState=g,t.baseState=S,t.baseQueue=F,o.lastRenderedState=g}return h===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Yu(t){var r=$t(),a=r.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=t;var o=a.dispatch,h=a.pending,g=r.memoizedState;if(h!==null){a.pending=null;var S=h=h.next;do g=t(g,S.action),S=S.next;while(S!==h);Hn(g,r.memoizedState)||(Pt=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),a.lastRenderedState=g}return[g,o]}function Th(t,r,a){var o=Pe,h=$t(),g=st;if(g){if(a===void 0)throw Error(i(407));a=a()}else a=r();var S=!Hn((St||h).memoizedState,a);if(S&&(h.memoizedState=a,Pt=!0),h=h.queue,Qu(_h.bind(null,o,h,t),[t]),h.getSnapshot!==r||S||Xt!==null&&Xt.memoizedState.tag&1){if(o.flags|=2048,Bi(9,{destroy:void 0},Oh.bind(null,o,h,a,r),null),Nt===null)throw Error(i(349));g||(zr&127)!==0||Ah(o,r,a)}return a}function Ah(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=Pe.updateQueue,r===null?(r=xo(),Pe.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function Oh(t,r,a,o){r.value=a,r.getSnapshot=o,Rh(r)&&Mh(t)}function _h(t,r,a){return a(function(){Rh(r)&&Mh(t)})}function Rh(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!Hn(t,a)}catch{return!0}}function Mh(t){var r=Il(t,2);r!==null&&zn(r,t,2)}function Xu(t){var r=jn();if(typeof t=="function"){var a=t;if(t=a(),Yl){ge(!0);try{a()}finally{ge(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:t},r}function zh(t,r,a,o){return t.baseState=a,Vu(t,St,typeof o=="function"?o:Dr)}function ZS(t,r,a,o,h){if(wo(t))throw Error(i(485));if(t=r.action,t!==null){var g={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){g.listeners.push(S)}};B.T!==null?a(!0):g.isTransition=!1,o(g),a=r.pending,a===null?(g.next=r.pending=g,Dh(r,g)):(g.next=a.next,r.pending=a.next=g)}}function Dh(t,r){var a=r.action,o=r.payload,h=t.state;if(r.isTransition){var g=B.T,S={};B.T=S;try{var E=a(h,o),F=B.S;F!==null&&F(S,E),Lh(t,r,E)}catch(ne){Pu(t,r,ne)}finally{g!==null&&S.types!==null&&(g.types=S.types),B.T=g}}else try{g=a(h,o),Lh(t,r,g)}catch(ne){Pu(t,r,ne)}}function Lh(t,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){Ih(t,r,o)},function(o){return Pu(t,r,o)}):Ih(t,r,a)}function Ih(t,r,a){r.status="fulfilled",r.value=a,Bh(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,Dh(t,a)))}function Pu(t,r,a){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do r.status="rejected",r.reason=a,Bh(r),r=r.next;while(r!==o)}t.action=null}function Bh(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function Hh(t,r){return r}function Uh(t,r){if(st){var a=Nt.formState;if(a!==null){e:{var o=Pe;if(st){if(_t){t:{for(var h=_t,g=lr;h.nodeType!==8;){if(!g){h=null;break t}if(h=ar(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){_t=ar(h.nextSibling),o=h.data==="F!";break e}}ll(o)}o=!1}o&&(r=a[0])}}return a=jn(),a.memoizedState=a.baseState=r,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hh,lastRenderedState:r},a.queue=o,a=ig.bind(null,Pe,o),o.dispatch=a,o=Xu(!1),g=ed.bind(null,Pe,!1,o.queue),o=jn(),h={state:r,dispatch:null,action:t,pending:null},o.queue=h,a=ZS.bind(null,Pe,h,g,a),h.dispatch=a,o.memoizedState=t,[r,a,!1]}function Fh(t){var r=$t();return $h(r,St,t)}function $h(t,r,a){if(r=Vu(t,r,Hh)[0],t=yo(Dr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var o=Ia(r)}catch(S){throw S===Mi?oo:S}else o=r;r=$t();var h=r.queue,g=h.dispatch;return a!==r.memoizedState&&(Pe.flags|=2048,Bi(9,{destroy:void 0},KS.bind(null,h,a),null)),[o,g,t]}function KS(t,r){t.action=r}function Gh(t){var r=$t(),a=St;if(a!==null)return $h(r,a,t);$t(),r=r.memoizedState,a=$t();var o=a.queue.dispatch;return a.memoizedState=t,[r,o,!1]}function Bi(t,r,a,o){return t={tag:t,create:a,deps:o,inst:r,next:null},r=Pe.updateQueue,r===null&&(r=xo(),Pe.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=t.next=t:(o=a.next,a.next=t,t.next=o,r.lastEffect=t),t}function qh(){return $t().memoizedState}function vo(t,r,a,o){var h=jn();Pe.flags|=t,h.memoizedState=Bi(1|r,{destroy:void 0},a,o===void 0?null:o)}function So(t,r,a,o){var h=$t();o=o===void 0?null:o;var g=h.memoizedState.inst;St!==null&&o!==null&&Hu(o,St.memoizedState.deps)?h.memoizedState=Bi(r,g,a,o):(Pe.flags|=t,h.memoizedState=Bi(1|r,g,a,o))}function Vh(t,r){vo(8390656,8,t,r)}function Qu(t,r){So(2048,8,t,r)}function WS(t){Pe.flags|=4;var r=Pe.updateQueue;if(r===null)r=xo(),Pe.updateQueue=r,r.events=[t];else{var a=r.events;a===null?r.events=[t]:a.push(t)}}function Yh(t){var r=$t().memoizedState;return WS({ref:r,nextImpl:t}),function(){if((pt&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}function Xh(t,r){return So(4,2,t,r)}function Ph(t,r){return So(4,4,t,r)}function Qh(t,r){if(typeof r=="function"){t=t();var a=r(t);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Zh(t,r,a){a=a!=null?a.concat([t]):null,So(4,4,Qh.bind(null,r,t),a)}function Zu(){}function Kh(t,r){var a=$t();r=r===void 0?null:r;var o=a.memoizedState;return r!==null&&Hu(r,o[1])?o[0]:(a.memoizedState=[t,r],t)}function Wh(t,r){var a=$t();r=r===void 0?null:r;var o=a.memoizedState;if(r!==null&&Hu(r,o[1]))return o[0];if(o=t(),Yl){ge(!0);try{t()}finally{ge(!1)}}return a.memoizedState=[o,r],o}function Ku(t,r,a){return a===void 0||(zr&1073741824)!==0&&(lt&261930)===0?t.memoizedState=r:(t.memoizedState=a,t=Jg(),Pe.lanes|=t,ml|=t,a)}function Jh(t,r,a,o){return Hn(a,r)?a:Di.current!==null?(t=Ku(t,a,o),Hn(t,r)||(Pt=!0),t):(zr&42)===0||(zr&1073741824)!==0&&(lt&261930)===0?(Pt=!0,t.memoizedState=a):(t=Jg(),Pe.lanes|=t,ml|=t,r)}function eg(t,r,a,o,h){var g=P.p;P.p=g!==0&&8>g?g:8;var S=B.T,E={};B.T=E,ed(t,!1,r,a);try{var F=h(),ne=B.S;if(ne!==null&&ne(E,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var de=XS(F,o);Ba(t,r,de,Vn(t))}else Ba(t,r,o,Vn(t))}catch(pe){Ba(t,r,{then:function(){},status:"rejected",reason:pe},Vn())}finally{P.p=g,S!==null&&E.types!==null&&(S.types=E.types),B.T=S}}function JS(){}function Wu(t,r,a,o){if(t.tag!==5)throw Error(i(476));var h=tg(t).queue;eg(t,h,r,oe,a===null?JS:function(){return ng(t),a(o)})}function tg(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:oe},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function ng(t){var r=tg(t);r.next===null&&(r=t.alternate.memoizedState),Ba(t,r.next.queue,{},Vn())}function Ju(){return fn(ts)}function rg(){return $t().memoizedState}function lg(){return $t().memoizedState}function e2(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=Vn();t=sl(a);var o=ol(r,t,a);o!==null&&(zn(o,r,a),Ma(o,r,a)),r={cache:Tu()},t.payload=r;return}r=r.return}}function t2(t,r,a){var o=Vn();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},wo(t)?ag(r,a):(a=xu(t,r,a,o),a!==null&&(zn(a,t,o),sg(a,r,o)))}function ig(t,r,a){var o=Vn();Ba(t,r,a,o)}function Ba(t,r,a,o){var h={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(wo(t))ag(r,h);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var S=r.lastRenderedState,E=g(S,a);if(h.hasEagerState=!0,h.eagerState=E,Hn(E,S))return to(t,r,h,0),Nt===null&&eo(),!1}catch{}finally{}if(a=xu(t,r,h,o),a!==null)return zn(a,t,o),sg(a,r,o),!0}return!1}function ed(t,r,a,o){if(o={lane:2,revertLane:Rd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},wo(t)){if(r)throw Error(i(479))}else r=xu(t,a,o,2),r!==null&&zn(r,t,2)}function wo(t){var r=t.alternate;return t===Pe||r!==null&&r===Pe}function ag(t,r){Li=ho=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function sg(t,r,a){if((a&4194048)!==0){var o=r.lanes;o&=t.pendingLanes,a|=o,r.lanes=a,fp(t,a)}}var Ha={readContext:fn,use:bo,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht};Ha.useEffectEvent=Ht;var og={readContext:fn,use:bo,useCallback:function(t,r){return jn().memoizedState=[t,r===void 0?null:r],t},useContext:fn,useEffect:Vh,useImperativeHandle:function(t,r,a){a=a!=null?a.concat([t]):null,vo(4194308,4,Qh.bind(null,r,t),a)},useLayoutEffect:function(t,r){return vo(4194308,4,t,r)},useInsertionEffect:function(t,r){vo(4,2,t,r)},useMemo:function(t,r){var a=jn();r=r===void 0?null:r;var o=t();if(Yl){ge(!0);try{t()}finally{ge(!1)}}return a.memoizedState=[o,r],o},useReducer:function(t,r,a){var o=jn();if(a!==void 0){var h=a(r);if(Yl){ge(!0);try{a(r)}finally{ge(!1)}}}else h=r;return o.memoizedState=o.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},o.queue=t,t=t.dispatch=t2.bind(null,Pe,t),[o.memoizedState,t]},useRef:function(t){var r=jn();return t={current:t},r.memoizedState=t},useState:function(t){t=Xu(t);var r=t.queue,a=ig.bind(null,Pe,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:Zu,useDeferredValue:function(t,r){var a=jn();return Ku(a,t,r)},useTransition:function(){var t=Xu(!1);return t=eg.bind(null,Pe,t.queue,!0,!1),jn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var o=Pe,h=jn();if(st){if(a===void 0)throw Error(i(407));a=a()}else{if(a=r(),Nt===null)throw Error(i(349));(lt&127)!==0||Ah(o,r,a)}h.memoizedState=a;var g={value:a,getSnapshot:r};return h.queue=g,Vh(_h.bind(null,o,g,t),[t]),o.flags|=2048,Bi(9,{destroy:void 0},Oh.bind(null,o,g,a,r),null),a},useId:function(){var t=jn(),r=Nt.identifierPrefix;if(st){var a=yr,o=br;a=(o&~(1<<32-we(o)-1)).toString(32)+a,r="_"+r+"R_"+a,a=go++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=PS++,r="_"+r+"r_"+a.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:Ju,useFormState:Uh,useActionState:Uh,useOptimistic:function(t){var r=jn();r.memoizedState=r.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=ed.bind(null,Pe,!0,a),a.dispatch=r,[t,r]},useMemoCache:qu,useCacheRefresh:function(){return jn().memoizedState=e2.bind(null,Pe)},useEffectEvent:function(t){var r=jn(),a={impl:t};return r.memoizedState=a,function(){if((pt&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},td={readContext:fn,use:bo,useCallback:Kh,useContext:fn,useEffect:Qu,useImperativeHandle:Zh,useInsertionEffect:Xh,useLayoutEffect:Ph,useMemo:Wh,useReducer:yo,useRef:qh,useState:function(){return yo(Dr)},useDebugValue:Zu,useDeferredValue:function(t,r){var a=$t();return Jh(a,St.memoizedState,t,r)},useTransition:function(){var t=yo(Dr)[0],r=$t().memoizedState;return[typeof t=="boolean"?t:Ia(t),r]},useSyncExternalStore:Th,useId:rg,useHostTransitionStatus:Ju,useFormState:Fh,useActionState:Fh,useOptimistic:function(t,r){var a=$t();return zh(a,St,t,r)},useMemoCache:qu,useCacheRefresh:lg};td.useEffectEvent=Yh;var cg={readContext:fn,use:bo,useCallback:Kh,useContext:fn,useEffect:Qu,useImperativeHandle:Zh,useInsertionEffect:Xh,useLayoutEffect:Ph,useMemo:Wh,useReducer:Yu,useRef:qh,useState:function(){return Yu(Dr)},useDebugValue:Zu,useDeferredValue:function(t,r){var a=$t();return St===null?Ku(a,t,r):Jh(a,St.memoizedState,t,r)},useTransition:function(){var t=Yu(Dr)[0],r=$t().memoizedState;return[typeof t=="boolean"?t:Ia(t),r]},useSyncExternalStore:Th,useId:rg,useHostTransitionStatus:Ju,useFormState:Gh,useActionState:Gh,useOptimistic:function(t,r){var a=$t();return St!==null?zh(a,St,t,r):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:qu,useCacheRefresh:lg};cg.useEffectEvent=Yh;function nd(t,r,a,o){r=t.memoizedState,a=a(o,r),a=a==null?r:b({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var rd={enqueueSetState:function(t,r,a){t=t._reactInternals;var o=Vn(),h=sl(o);h.payload=r,a!=null&&(h.callback=a),r=ol(t,h,o),r!==null&&(zn(r,t,o),Ma(r,t,o))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var o=Vn(),h=sl(o);h.tag=1,h.payload=r,a!=null&&(h.callback=a),r=ol(t,h,o),r!==null&&(zn(r,t,o),Ma(r,t,o))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=Vn(),o=sl(a);o.tag=2,r!=null&&(o.callback=r),r=ol(t,o,a),r!==null&&(zn(r,t,a),Ma(r,t,a))}};function ug(t,r,a,o,h,g,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,g,S):r.prototype&&r.prototype.isPureReactComponent?!Na(a,o)||!Na(h,g):!0}function dg(t,r,a,o){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,o),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,o),r.state!==t&&rd.enqueueReplaceState(r,r.state,null)}function Xl(t,r){var a=r;if("ref"in r){a={};for(var o in r)o!=="ref"&&(a[o]=r[o])}if(t=t.defaultProps){a===r&&(a=b({},a));for(var h in t)a[h]===void 0&&(a[h]=t[h])}return a}function fg(t){Js(t)}function mg(t){console.error(t)}function pg(t){Js(t)}function ko(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(o){setTimeout(function(){throw o})}}function hg(t,r,a){try{var o=t.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function ld(t,r,a){return a=sl(a),a.tag=3,a.payload={element:null},a.callback=function(){ko(t,r)},a}function gg(t){return t=sl(t),t.tag=3,t}function xg(t,r,a,o){var h=a.type.getDerivedStateFromError;if(typeof h=="function"){var g=o.value;t.payload=function(){return h(g)},t.callback=function(){hg(r,a,o)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){hg(r,a,o),typeof h!="function"&&(pl===null?pl=new Set([this]):pl.add(this));var E=o.stack;this.componentDidCatch(o.value,{componentStack:E!==null?E:""})})}function n2(t,r,a,o,h){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(r=a.alternate,r!==null&&Oi(r,a,h,!0),a=Fn.current,a!==null){switch(a.tag){case 31:case 13:return ir===null?Do():a.alternate===null&&Ut===0&&(Ut=3),a.flags&=-257,a.flags|=65536,a.lanes=h,o===co?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([o]):r.add(o),Ad(t,o,h)),!1;case 22:return a.flags|=65536,o===co?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([o]):a.add(o)),Ad(t,o,h)),!1}throw Error(i(435,a.tag))}return Ad(t,o,h),Do(),!1}if(st)return r=Fn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=h,o!==ku&&(t=Error(i(422),{cause:o}),Ta(tr(t,a)))):(o!==ku&&(r=Error(i(423),{cause:o}),Ta(tr(r,a))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,o=tr(o,a),h=ld(t.stateNode,o,h),zu(t,h),Ut!==4&&(Ut=2)),!1;var g=Error(i(520),{cause:o});if(g=tr(g,a),Xa===null?Xa=[g]:Xa.push(g),Ut!==4&&(Ut=2),r===null)return!0;o=tr(o,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,t=h&-h,a.lanes|=t,t=ld(a.stateNode,o,t),zu(a,t),!1;case 1:if(r=a.type,g=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(pl===null||!pl.has(g))))return a.flags|=65536,h&=-h,a.lanes|=h,h=gg(h),xg(h,t,a,o),zu(a,h),!1}a=a.return}while(a!==null);return!1}var id=Error(i(461)),Pt=!1;function mn(t,r,a,o){r.child=t===null?Sh(r,null,a,o):Vl(r,t.child,a,o)}function bg(t,r,a,o,h){a=a.render;var g=r.ref;if("ref"in o){var S={};for(var E in o)E!=="ref"&&(S[E]=o[E])}else S=o;return Fl(r),o=Uu(t,r,a,S,g,h),E=Fu(),t!==null&&!Pt?($u(t,r,h),Lr(t,r,h)):(st&&E&&Su(r),r.flags|=1,mn(t,r,o,h),r.child)}function yg(t,r,a,o,h){if(t===null){var g=a.type;return typeof g=="function"&&!bu(g)&&g.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=g,vg(t,r,g,o,h)):(t=ro(a.type,null,o,r,r.mode,h),t.ref=r.ref,t.return=r,r.child=t)}if(g=t.child,!md(t,h)){var S=g.memoizedProps;if(a=a.compare,a=a!==null?a:Na,a(S,o)&&t.ref===r.ref)return Lr(t,r,h)}return r.flags|=1,t=Or(g,o),t.ref=r.ref,t.return=r,r.child=t}function vg(t,r,a,o,h){if(t!==null){var g=t.memoizedProps;if(Na(g,o)&&t.ref===r.ref)if(Pt=!1,r.pendingProps=o=g,md(t,h))(t.flags&131072)!==0&&(Pt=!0);else return r.lanes=t.lanes,Lr(t,r,h)}return ad(t,r,a,o,h)}function Sg(t,r,a,o){var h=o.children,g=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((r.flags&128)!==0){if(g=g!==null?g.baseLanes|a:a,t!==null){for(o=r.child=t.child,h=0;o!==null;)h=h|o.lanes|o.childLanes,o=o.sibling;o=h&~g}else o=0,r.child=null;return wg(t,r,g,a,o)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&so(r,g!==null?g.cachePool:null),g!==null?jh(r,g):Lu(),Nh(r);else return o=r.lanes=536870912,wg(t,r,g!==null?g.baseLanes|a:a,a,o)}else g!==null?(so(r,g.cachePool),jh(r,g),ul(),r.memoizedState=null):(t!==null&&so(r,null),Lu(),ul());return mn(t,r,h,a),r.child}function Ua(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function wg(t,r,a,o,h){var g=Ou();return g=g===null?null:{parent:Yt._currentValue,pool:g},r.memoizedState={baseLanes:a,cachePool:g},t!==null&&so(r,null),Lu(),Nh(r),t!==null&&Oi(t,r,o,!0),r.childLanes=h,null}function jo(t,r){return r=Co({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function kg(t,r,a){return Vl(r,t.child,null,a),t=jo(r,r.pendingProps),t.flags|=2,$n(r),r.memoizedState=null,t}function r2(t,r,a){var o=r.pendingProps,h=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(st){if(o.mode==="hidden")return t=jo(r,o),r.lanes=536870912,Ua(null,t);if(Bu(r),(t=_t)?(t=Dx(t,lr),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:nl!==null?{id:br,overflow:yr}:null,retryLane:536870912,hydrationErrors:null},a=ah(t),a.return=r,r.child=a,dn=r,_t=null)):t=null,t===null)throw ll(r);return r.lanes=536870912,null}return jo(r,o)}var g=t.memoizedState;if(g!==null){var S=g.dehydrated;if(Bu(r),h)if(r.flags&256)r.flags&=-257,r=kg(t,r,a);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(i(558));else if(Pt||Oi(t,r,a,!1),h=(a&t.childLanes)!==0,Pt||h){if(o=Nt,o!==null&&(S=mp(o,a),S!==0&&S!==g.retryLane))throw g.retryLane=S,Il(t,S),zn(o,t,S),id;Do(),r=kg(t,r,a)}else t=g.treeContext,_t=ar(S.nextSibling),dn=r,st=!0,rl=null,lr=!1,t!==null&&ch(r,t),r=jo(r,o),r.flags|=4096;return r}return t=Or(t.child,{mode:o.mode,children:o.children}),t.ref=r.ref,r.child=t,t.return=r,t}function No(t,r){var a=r.ref;if(a===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(t===null||t.ref!==a)&&(r.flags|=4194816)}}function ad(t,r,a,o,h){return Fl(r),a=Uu(t,r,a,o,void 0,h),o=Fu(),t!==null&&!Pt?($u(t,r,h),Lr(t,r,h)):(st&&o&&Su(r),r.flags|=1,mn(t,r,a,h),r.child)}function jg(t,r,a,o,h,g){return Fl(r),r.updateQueue=null,a=Eh(r,o,a,h),Ch(t),o=Fu(),t!==null&&!Pt?($u(t,r,g),Lr(t,r,g)):(st&&o&&Su(r),r.flags|=1,mn(t,r,a,g),r.child)}function Ng(t,r,a,o,h){if(Fl(r),r.stateNode===null){var g=Ci,S=a.contextType;typeof S=="object"&&S!==null&&(g=fn(S)),g=new a(o,g),r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=rd,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=o,g.state=r.memoizedState,g.refs={},Ru(r),S=a.contextType,g.context=typeof S=="object"&&S!==null?fn(S):Ci,g.state=r.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(nd(r,a,S,o),g.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(S=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),S!==g.state&&rd.enqueueReplaceState(g,g.state,null),Da(r,o,g,h),za(),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308),o=!0}else if(t===null){g=r.stateNode;var E=r.memoizedProps,F=Xl(a,E);g.props=F;var ne=g.context,de=a.contextType;S=Ci,typeof de=="object"&&de!==null&&(S=fn(de));var pe=a.getDerivedStateFromProps;de=typeof pe=="function"||typeof g.getSnapshotBeforeUpdate=="function",E=r.pendingProps!==E,de||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(E||ne!==S)&&dg(r,g,o,S),al=!1;var ie=r.memoizedState;g.state=ie,Da(r,o,g,h),za(),ne=r.memoizedState,E||ie!==ne||al?(typeof pe=="function"&&(nd(r,a,pe,o),ne=r.memoizedState),(F=al||ug(r,a,F,o,ie,ne,S))?(de||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(r.flags|=4194308)):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=o,r.memoizedState=ne),g.props=o,g.state=ne,g.context=S,o=F):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),o=!1)}else{g=r.stateNode,Mu(t,r),S=r.memoizedProps,de=Xl(a,S),g.props=de,pe=r.pendingProps,ie=g.context,ne=a.contextType,F=Ci,typeof ne=="object"&&ne!==null&&(F=fn(ne)),E=a.getDerivedStateFromProps,(ne=typeof E=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==pe||ie!==F)&&dg(r,g,o,F),al=!1,ie=r.memoizedState,g.state=ie,Da(r,o,g,h),za();var se=r.memoizedState;S!==pe||ie!==se||al||t!==null&&t.dependencies!==null&&io(t.dependencies)?(typeof E=="function"&&(nd(r,a,E,o),se=r.memoizedState),(de=al||ug(r,a,de,o,ie,se,F)||t!==null&&t.dependencies!==null&&io(t.dependencies))?(ne||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(o,se,F),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(o,se,F)),typeof g.componentDidUpdate=="function"&&(r.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&ie===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ie===t.memoizedState||(r.flags|=1024),r.memoizedProps=o,r.memoizedState=se),g.props=o,g.state=se,g.context=F,o=de):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&ie===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ie===t.memoizedState||(r.flags|=1024),o=!1)}return g=o,No(t,r),o=(r.flags&128)!==0,g||o?(g=r.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:g.render(),r.flags|=1,t!==null&&o?(r.child=Vl(r,t.child,null,h),r.child=Vl(r,null,a,h)):mn(t,r,a,h),r.memoizedState=g.state,t=r.child):t=Lr(t,r,h),t}function Cg(t,r,a,o){return Hl(),r.flags|=256,mn(t,r,a,o),r.child}var sd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function od(t){return{baseLanes:t,cachePool:hh()}}function cd(t,r,a){return t=t!==null?t.childLanes&~a:0,r&&(t|=qn),t}function Eg(t,r,a){var o=r.pendingProps,h=!1,g=(r.flags&128)!==0,S;if((S=g)||(S=t!==null&&t.memoizedState===null?!1:(Ft.current&2)!==0),S&&(h=!0,r.flags&=-129),S=(r.flags&32)!==0,r.flags&=-33,t===null){if(st){if(h?cl(r):ul(),(t=_t)?(t=Dx(t,lr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:nl!==null?{id:br,overflow:yr}:null,retryLane:536870912,hydrationErrors:null},a=ah(t),a.return=r,r.child=a,dn=r,_t=null)):t=null,t===null)throw ll(r);return Vd(t)?r.lanes=32:r.lanes=536870912,null}var E=o.children;return o=o.fallback,h?(ul(),h=r.mode,E=Co({mode:"hidden",children:E},h),o=Bl(o,h,a,null),E.return=r,o.return=r,E.sibling=o,r.child=E,o=r.child,o.memoizedState=od(a),o.childLanes=cd(t,S,a),r.memoizedState=sd,Ua(null,o)):(cl(r),ud(r,E))}var F=t.memoizedState;if(F!==null&&(E=F.dehydrated,E!==null)){if(g)r.flags&256?(cl(r),r.flags&=-257,r=dd(t,r,a)):r.memoizedState!==null?(ul(),r.child=t.child,r.flags|=128,r=null):(ul(),E=o.fallback,h=r.mode,o=Co({mode:"visible",children:o.children},h),E=Bl(E,h,a,null),E.flags|=2,o.return=r,E.return=r,o.sibling=E,r.child=o,Vl(r,t.child,null,a),o=r.child,o.memoizedState=od(a),o.childLanes=cd(t,S,a),r.memoizedState=sd,r=Ua(null,o));else if(cl(r),Vd(E)){if(S=E.nextSibling&&E.nextSibling.dataset,S)var ne=S.dgst;S=ne,o=Error(i(419)),o.stack="",o.digest=S,Ta({value:o,source:null,stack:null}),r=dd(t,r,a)}else if(Pt||Oi(t,r,a,!1),S=(a&t.childLanes)!==0,Pt||S){if(S=Nt,S!==null&&(o=mp(S,a),o!==0&&o!==F.retryLane))throw F.retryLane=o,Il(t,o),zn(S,t,o),id;qd(E)||Do(),r=dd(t,r,a)}else qd(E)?(r.flags|=192,r.child=t.child,r=null):(t=F.treeContext,_t=ar(E.nextSibling),dn=r,st=!0,rl=null,lr=!1,t!==null&&ch(r,t),r=ud(r,o.children),r.flags|=4096);return r}return h?(ul(),E=o.fallback,h=r.mode,F=t.child,ne=F.sibling,o=Or(F,{mode:"hidden",children:o.children}),o.subtreeFlags=F.subtreeFlags&65011712,ne!==null?E=Or(ne,E):(E=Bl(E,h,a,null),E.flags|=2),E.return=r,o.return=r,o.sibling=E,r.child=o,Ua(null,o),o=r.child,E=t.child.memoizedState,E===null?E=od(a):(h=E.cachePool,h!==null?(F=Yt._currentValue,h=h.parent!==F?{parent:F,pool:F}:h):h=hh(),E={baseLanes:E.baseLanes|a,cachePool:h}),o.memoizedState=E,o.childLanes=cd(t,S,a),r.memoizedState=sd,Ua(t.child,o)):(cl(r),a=t.child,t=a.sibling,a=Or(a,{mode:"visible",children:o.children}),a.return=r,a.sibling=null,t!==null&&(S=r.deletions,S===null?(r.deletions=[t],r.flags|=16):S.push(t)),r.child=a,r.memoizedState=null,a)}function ud(t,r){return r=Co({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Co(t,r){return t=Un(22,t,null,r),t.lanes=0,t}function dd(t,r,a){return Vl(r,t.child,null,a),t=ud(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function Tg(t,r,a){t.lanes|=r;var o=t.alternate;o!==null&&(o.lanes|=r),Cu(t.return,r,a)}function fd(t,r,a,o,h,g){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:h,treeForkCount:g}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=o,S.tail=a,S.tailMode=h,S.treeForkCount=g)}function Ag(t,r,a){var o=r.pendingProps,h=o.revealOrder,g=o.tail;o=o.children;var S=Ft.current,E=(S&2)!==0;if(E?(S=S&1|2,r.flags|=128):S&=1,O(Ft,S),mn(t,r,o,a),o=st?Ea:0,!E&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Tg(t,a,r);else if(t.tag===19)Tg(t,a,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(h){case"forwards":for(a=r.child,h=null;a!==null;)t=a.alternate,t!==null&&po(t)===null&&(h=a),a=a.sibling;a=h,a===null?(h=r.child,r.child=null):(h=a.sibling,a.sibling=null),fd(r,!1,h,a,g,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,h=r.child,r.child=null;h!==null;){if(t=h.alternate,t!==null&&po(t)===null){r.child=h;break}t=h.sibling,h.sibling=a,a=h,h=t}fd(r,!0,a,null,g,o);break;case"together":fd(r,!1,null,null,void 0,o);break;default:r.memoizedState=null}return r.child}function Lr(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),ml|=r.lanes,(a&r.childLanes)===0)if(t!==null){if(Oi(t,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(i(153));if(r.child!==null){for(t=r.child,a=Or(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=Or(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function md(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&io(t)))}function l2(t,r,a){switch(r.tag){case 3:le(r,r.stateNode.containerInfo),il(r,Yt,t.memoizedState.cache),Hl();break;case 27:case 5:Te(r);break;case 4:le(r,r.stateNode.containerInfo);break;case 10:il(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Bu(r),null;break;case 13:var o=r.memoizedState;if(o!==null)return o.dehydrated!==null?(cl(r),r.flags|=128,null):(a&r.child.childLanes)!==0?Eg(t,r,a):(cl(r),t=Lr(t,r,a),t!==null?t.sibling:null);cl(r);break;case 19:var h=(t.flags&128)!==0;if(o=(a&r.childLanes)!==0,o||(Oi(t,r,a,!1),o=(a&r.childLanes)!==0),h){if(o)return Ag(t,r,a);r.flags|=128}if(h=r.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),O(Ft,Ft.current),o)break;return null;case 22:return r.lanes=0,Sg(t,r,a,r.pendingProps);case 24:il(r,Yt,t.memoizedState.cache)}return Lr(t,r,a)}function Og(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)Pt=!0;else{if(!md(t,a)&&(r.flags&128)===0)return Pt=!1,l2(t,r,a);Pt=(t.flags&131072)!==0}else Pt=!1,st&&(r.flags&1048576)!==0&&oh(r,Ea,r.index);switch(r.lanes=0,r.tag){case 16:e:{var o=r.pendingProps;if(t=Gl(r.elementType),r.type=t,typeof t=="function")bu(t)?(o=Xl(t,o),r.tag=1,r=Ng(null,r,t,o,a)):(r.tag=0,r=ad(null,r,t,o,a));else{if(t!=null){var h=t.$$typeof;if(h===L){r.tag=11,r=bg(null,r,t,o,a);break e}else if(h===R){r.tag=14,r=yg(null,r,t,o,a);break e}}throw r=H(t)||t,Error(i(306,r,""))}}return r;case 0:return ad(t,r,r.type,r.pendingProps,a);case 1:return o=r.type,h=Xl(o,r.pendingProps),Ng(t,r,o,h,a);case 3:e:{if(le(r,r.stateNode.containerInfo),t===null)throw Error(i(387));o=r.pendingProps;var g=r.memoizedState;h=g.element,Mu(t,r),Da(r,o,null,a);var S=r.memoizedState;if(o=S.cache,il(r,Yt,o),o!==g.cache&&Eu(r,[Yt],a,!0),za(),o=S.element,g.isDehydrated)if(g={element:o,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=g,r.memoizedState=g,r.flags&256){r=Cg(t,r,o,a);break e}else if(o!==h){h=tr(Error(i(424)),r),Ta(h),r=Cg(t,r,o,a);break e}else{switch(t=r.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(_t=ar(t.firstChild),dn=r,st=!0,rl=null,lr=!0,a=Sh(r,null,o,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Hl(),o===h){r=Lr(t,r,a);break e}mn(t,r,o,a)}r=r.child}return r;case 26:return No(t,r),t===null?(a=Fx(r.type,null,r.pendingProps,null))?r.memoizedState=a:st||(a=r.type,t=r.pendingProps,o=$o(re.current).createElement(a),o[un]=r,o[Tn]=t,pn(o,a,t),sn(o),r.stateNode=o):r.memoizedState=Fx(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return Te(r),t===null&&st&&(o=r.stateNode=Bx(r.type,r.pendingProps,re.current),dn=r,lr=!0,h=_t,bl(r.type)?(Yd=h,_t=ar(o.firstChild)):_t=h),mn(t,r,r.pendingProps.children,a),No(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&st&&((h=o=_t)&&(o=z2(o,r.type,r.pendingProps,lr),o!==null?(r.stateNode=o,dn=r,_t=ar(o.firstChild),lr=!1,h=!0):h=!1),h||ll(r)),Te(r),h=r.type,g=r.pendingProps,S=t!==null?t.memoizedProps:null,o=g.children,Fd(h,g)?o=null:S!==null&&Fd(h,S)&&(r.flags|=32),r.memoizedState!==null&&(h=Uu(t,r,QS,null,null,a),ts._currentValue=h),No(t,r),mn(t,r,o,a),r.child;case 6:return t===null&&st&&((t=a=_t)&&(a=D2(a,r.pendingProps,lr),a!==null?(r.stateNode=a,dn=r,_t=null,t=!0):t=!1),t||ll(r)),null;case 13:return Eg(t,r,a);case 4:return le(r,r.stateNode.containerInfo),o=r.pendingProps,t===null?r.child=Vl(r,null,o,a):mn(t,r,o,a),r.child;case 11:return bg(t,r,r.type,r.pendingProps,a);case 7:return mn(t,r,r.pendingProps,a),r.child;case 8:return mn(t,r,r.pendingProps.children,a),r.child;case 12:return mn(t,r,r.pendingProps.children,a),r.child;case 10:return o=r.pendingProps,il(r,r.type,o.value),mn(t,r,o.children,a),r.child;case 9:return h=r.type._context,o=r.pendingProps.children,Fl(r),h=fn(h),o=o(h),r.flags|=1,mn(t,r,o,a),r.child;case 14:return yg(t,r,r.type,r.pendingProps,a);case 15:return vg(t,r,r.type,r.pendingProps,a);case 19:return Ag(t,r,a);case 31:return r2(t,r,a);case 22:return Sg(t,r,a,r.pendingProps);case 24:return Fl(r),o=fn(Yt),t===null?(h=Ou(),h===null&&(h=Nt,g=Tu(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=a),h=g),r.memoizedState={parent:o,cache:h},Ru(r),il(r,Yt,h)):((t.lanes&a)!==0&&(Mu(t,r),Da(r,null,null,a),za()),h=t.memoizedState,g=r.memoizedState,h.parent!==o?(h={parent:o,cache:o},r.memoizedState=h,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=h),il(r,Yt,o)):(o=g.cache,il(r,Yt,o),o!==h.cache&&Eu(r,[Yt],a,!0))),mn(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(i(156,r.tag))}function Ir(t){t.flags|=4}function pd(t,r,a,o,h){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(rx())t.flags|=8192;else throw ql=co,_u}else t.flags&=-16777217}function _g(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Yx(r))if(rx())t.flags|=8192;else throw ql=co,_u}function Eo(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?up():536870912,t.lanes|=r,$i|=r)}function Fa(t,r){if(!st)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function Rt(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,o=0;if(r)for(var h=t.child;h!==null;)a|=h.lanes|h.childLanes,o|=h.subtreeFlags&65011712,o|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)a|=h.lanes|h.childLanes,o|=h.subtreeFlags,o|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=o,t.childLanes=a,r}function i2(t,r,a){var o=r.pendingProps;switch(wu(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(r),null;case 1:return Rt(r),null;case 3:return a=r.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),Mr(Yt),xe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(Ai(r)?Ir(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,ju())),Rt(r),null;case 26:var h=r.type,g=r.memoizedState;return t===null?(Ir(r),g!==null?(Rt(r),_g(r,g)):(Rt(r),pd(r,h,null,o,a))):g?g!==t.memoizedState?(Ir(r),Rt(r),_g(r,g)):(Rt(r),r.flags&=-16777217):(t=t.memoizedProps,t!==o&&Ir(r),Rt(r),pd(r,h,t,o,a)),null;case 27:if(je(r),a=re.current,h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==o&&Ir(r);else{if(!o){if(r.stateNode===null)throw Error(i(166));return Rt(r),null}t=$.current,Ai(r)?uh(r):(t=Bx(h,o,a),r.stateNode=t,Ir(r))}return Rt(r),null;case 5:if(je(r),h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==o&&Ir(r);else{if(!o){if(r.stateNode===null)throw Error(i(166));return Rt(r),null}if(g=$.current,Ai(r))uh(r);else{var S=$o(re.current);switch(g){case 1:g=S.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=S.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=S.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof o.is=="string"?S.createElement("select",{is:o.is}):S.createElement("select"),o.multiple?g.multiple=!0:o.size&&(g.size=o.size);break;default:g=typeof o.is=="string"?S.createElement(h,{is:o.is}):S.createElement(h)}}g[un]=r,g[Tn]=o;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)g.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break e;for(;S.sibling===null;){if(S.return===null||S.return===r)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=g;e:switch(pn(g,h,o),h){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Ir(r)}}return Rt(r),pd(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==o&&Ir(r);else{if(typeof o!="string"&&r.stateNode===null)throw Error(i(166));if(t=re.current,Ai(r)){if(t=r.stateNode,a=r.memoizedProps,o=null,h=dn,h!==null)switch(h.tag){case 27:case 5:o=h.memoizedProps}t[un]=r,t=!!(t.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||Ex(t.nodeValue,a)),t||ll(r,!0)}else t=$o(t).createTextNode(o),t[un]=r,r.stateNode=t}return Rt(r),null;case 31:if(a=r.memoizedState,t===null||t.memoizedState!==null){if(o=Ai(r),a!==null){if(t===null){if(!o)throw Error(i(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(557));t[un]=r}else Hl(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Rt(r),t=!1}else a=ju(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return r.flags&256?($n(r),r):($n(r),null);if((r.flags&128)!==0)throw Error(i(558))}return Rt(r),null;case 13:if(o=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Ai(r),o!==null&&o.dehydrated!==null){if(t===null){if(!h)throw Error(i(318));if(h=r.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(i(317));h[un]=r}else Hl(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Rt(r),h=!1}else h=ju(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return r.flags&256?($n(r),r):($n(r),null)}return $n(r),(r.flags&128)!==0?(r.lanes=a,r):(a=o!==null,t=t!==null&&t.memoizedState!==null,a&&(o=r.child,h=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(h=o.alternate.memoizedState.cachePool.pool),g=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(g=o.memoizedState.cachePool.pool),g!==h&&(o.flags|=2048)),a!==t&&a&&(r.child.flags|=8192),Eo(r,r.updateQueue),Rt(r),null);case 4:return xe(),t===null&&Ld(r.stateNode.containerInfo),Rt(r),null;case 10:return Mr(r.type),Rt(r),null;case 19:if(W(Ft),o=r.memoizedState,o===null)return Rt(r),null;if(h=(r.flags&128)!==0,g=o.rendering,g===null)if(h)Fa(o,!1);else{if(Ut!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(g=po(t),g!==null){for(r.flags|=128,Fa(o,!1),t=g.updateQueue,r.updateQueue=t,Eo(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)ih(a,t),a=a.sibling;return O(Ft,Ft.current&1|2),st&&_r(r,o.treeForkCount),r.child}t=t.sibling}o.tail!==null&&Ot()>Ro&&(r.flags|=128,h=!0,Fa(o,!1),r.lanes=4194304)}else{if(!h)if(t=po(g),t!==null){if(r.flags|=128,h=!0,t=t.updateQueue,r.updateQueue=t,Eo(r,t),Fa(o,!0),o.tail===null&&o.tailMode==="hidden"&&!g.alternate&&!st)return Rt(r),null}else 2*Ot()-o.renderingStartTime>Ro&&a!==536870912&&(r.flags|=128,h=!0,Fa(o,!1),r.lanes=4194304);o.isBackwards?(g.sibling=r.child,r.child=g):(t=o.last,t!==null?t.sibling=g:r.child=g,o.last=g)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ot(),t.sibling=null,a=Ft.current,O(Ft,h?a&1|2:a&1),st&&_r(r,o.treeForkCount),t):(Rt(r),null);case 22:case 23:return $n(r),Iu(),o=r.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(r.flags|=8192):o&&(r.flags|=8192),o?(a&536870912)!==0&&(r.flags&128)===0&&(Rt(r),r.subtreeFlags&6&&(r.flags|=8192)):Rt(r),a=r.updateQueue,a!==null&&Eo(r,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048),t!==null&&W($l),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Mr(Yt),Rt(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function a2(t,r){switch(wu(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Mr(Yt),xe(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return je(r),null;case 31:if(r.memoizedState!==null){if($n(r),r.alternate===null)throw Error(i(340));Hl()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if($n(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(i(340));Hl()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return W(Ft),null;case 4:return xe(),null;case 10:return Mr(r.type),null;case 22:case 23:return $n(r),Iu(),t!==null&&W($l),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Mr(Yt),null;case 25:return null;default:return null}}function Rg(t,r){switch(wu(r),r.tag){case 3:Mr(Yt),xe();break;case 26:case 27:case 5:je(r);break;case 4:xe();break;case 31:r.memoizedState!==null&&$n(r);break;case 13:$n(r);break;case 19:W(Ft);break;case 10:Mr(r.type);break;case 22:case 23:$n(r),Iu(),t!==null&&W($l);break;case 24:Mr(Yt)}}function $a(t,r){try{var a=r.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var h=o.next;a=h;do{if((a.tag&t)===t){o=void 0;var g=a.create,S=a.inst;o=g(),S.destroy=o}a=a.next}while(a!==h)}}catch(E){bt(r,r.return,E)}}function dl(t,r,a){try{var o=r.updateQueue,h=o!==null?o.lastEffect:null;if(h!==null){var g=h.next;o=g;do{if((o.tag&t)===t){var S=o.inst,E=S.destroy;if(E!==void 0){S.destroy=void 0,h=r;var F=a,ne=E;try{ne()}catch(de){bt(h,F,de)}}}o=o.next}while(o!==g)}}catch(de){bt(r,r.return,de)}}function Mg(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{kh(r,a)}catch(o){bt(t,t.return,o)}}}function zg(t,r,a){a.props=Xl(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(o){bt(t,r,o)}}function Ga(t,r){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof a=="function"?t.refCleanup=a(o):a.current=o}}catch(h){bt(t,r,h)}}function vr(t,r){var a=t.ref,o=t.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(h){bt(t,r,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(h){bt(t,r,h)}else a.current=null}function Dg(t){var r=t.type,a=t.memoizedProps,o=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break e;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(h){bt(t,t.return,h)}}function hd(t,r,a){try{var o=t.stateNode;T2(o,t.type,a,r),o[Tn]=r}catch(h){bt(t,t.return,h)}}function Lg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&bl(t.type)||t.tag===4}function gd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Lg(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&bl(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function xd(t,r,a){var o=t.tag;if(o===5||o===6)t=t.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(t),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=Tr));else if(o!==4&&(o===27&&bl(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(xd(t,r,a),t=t.sibling;t!==null;)xd(t,r,a),t=t.sibling}function To(t,r,a){var o=t.tag;if(o===5||o===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(o!==4&&(o===27&&bl(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(To(t,r,a),t=t.sibling;t!==null;)To(t,r,a),t=t.sibling}function Ig(t){var r=t.stateNode,a=t.memoizedProps;try{for(var o=t.type,h=r.attributes;h.length;)r.removeAttributeNode(h[0]);pn(r,o,a),r[un]=t,r[Tn]=a}catch(g){bt(t,t.return,g)}}var Br=!1,Qt=!1,bd=!1,Bg=typeof WeakSet=="function"?WeakSet:Set,on=null;function s2(t,r){if(t=t.containerInfo,Hd=Qo,t=Zp(t),du(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var h=o.anchorOffset,g=o.focusNode;o=o.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break e}var S=0,E=-1,F=-1,ne=0,de=0,pe=t,ie=null;t:for(;;){for(var se;pe!==a||h!==0&&pe.nodeType!==3||(E=S+h),pe!==g||o!==0&&pe.nodeType!==3||(F=S+o),pe.nodeType===3&&(S+=pe.nodeValue.length),(se=pe.firstChild)!==null;)ie=pe,pe=se;for(;;){if(pe===t)break t;if(ie===a&&++ne===h&&(E=S),ie===g&&++de===o&&(F=S),(se=pe.nextSibling)!==null)break;pe=ie,ie=pe.parentNode}pe=se}a=E===-1||F===-1?null:{start:E,end:F}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ud={focusedElem:t,selectionRange:a},Qo=!1,on=r;on!==null;)if(r=on,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,on=t;else for(;on!==null;){switch(r=on,g=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)h=t[a],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&g!==null){t=void 0,a=r,h=g.memoizedProps,g=g.memoizedState,o=a.stateNode;try{var Ee=Xl(a.type,h);t=o.getSnapshotBeforeUpdate(Ee,g),o.__reactInternalSnapshotBeforeUpdate=t}catch(Be){bt(a,a.return,Be)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)Gd(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Gd(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(i(163))}if(t=r.sibling,t!==null){t.return=r.return,on=t;break}on=r.return}}function Hg(t,r,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:Ur(t,a),o&4&&$a(5,a);break;case 1:if(Ur(t,a),o&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(S){bt(a,a.return,S)}else{var h=Xl(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(h,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){bt(a,a.return,S)}}o&64&&Mg(a),o&512&&Ga(a,a.return);break;case 3:if(Ur(t,a),o&64&&(t=a.updateQueue,t!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{kh(t,r)}catch(S){bt(a,a.return,S)}}break;case 27:r===null&&o&4&&Ig(a);case 26:case 5:Ur(t,a),r===null&&o&4&&Dg(a),o&512&&Ga(a,a.return);break;case 12:Ur(t,a);break;case 31:Ur(t,a),o&4&&$g(t,a);break;case 13:Ur(t,a),o&4&&Gg(t,a),o&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=g2.bind(null,a),L2(t,a))));break;case 22:if(o=a.memoizedState!==null||Br,!o){r=r!==null&&r.memoizedState!==null||Qt,h=Br;var g=Qt;Br=o,(Qt=r)&&!g?Fr(t,a,(a.subtreeFlags&8772)!==0):Ur(t,a),Br=h,Qt=g}break;case 30:break;default:Ur(t,a)}}function Ug(t){var r=t.alternate;r!==null&&(t.alternate=null,Ug(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&Pc(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Dt=null,On=!1;function Hr(t,r,a){for(a=a.child;a!==null;)Fg(t,r,a),a=a.sibling}function Fg(t,r,a){if(ue&&typeof ue.onCommitFiberUnmount=="function")try{ue.onCommitFiberUnmount(Qe,a)}catch{}switch(a.tag){case 26:Qt||vr(a,r),Hr(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Qt||vr(a,r);var o=Dt,h=On;bl(a.type)&&(Dt=a.stateNode,On=!1),Hr(t,r,a),Wa(a.stateNode),Dt=o,On=h;break;case 5:Qt||vr(a,r);case 6:if(o=Dt,h=On,Dt=null,Hr(t,r,a),Dt=o,On=h,Dt!==null)if(On)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(a.stateNode)}catch(g){bt(a,r,g)}else try{Dt.removeChild(a.stateNode)}catch(g){bt(a,r,g)}break;case 18:Dt!==null&&(On?(t=Dt,Mx(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Zi(t)):Mx(Dt,a.stateNode));break;case 4:o=Dt,h=On,Dt=a.stateNode.containerInfo,On=!0,Hr(t,r,a),Dt=o,On=h;break;case 0:case 11:case 14:case 15:dl(2,a,r),Qt||dl(4,a,r),Hr(t,r,a);break;case 1:Qt||(vr(a,r),o=a.stateNode,typeof o.componentWillUnmount=="function"&&zg(a,r,o)),Hr(t,r,a);break;case 21:Hr(t,r,a);break;case 22:Qt=(o=Qt)||a.memoizedState!==null,Hr(t,r,a),Qt=o;break;default:Hr(t,r,a)}}function $g(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Zi(t)}catch(a){bt(r,r.return,a)}}}function Gg(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Zi(t)}catch(a){bt(r,r.return,a)}}function o2(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new Bg),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new Bg),r;default:throw Error(i(435,t.tag))}}function Ao(t,r){var a=o2(t);r.forEach(function(o){if(!a.has(o)){a.add(o);var h=x2.bind(null,t,o);o.then(h,h)}})}function _n(t,r){var a=r.deletions;if(a!==null)for(var o=0;o<a.length;o++){var h=a[o],g=t,S=r,E=S;e:for(;E!==null;){switch(E.tag){case 27:if(bl(E.type)){Dt=E.stateNode,On=!1;break e}break;case 5:Dt=E.stateNode,On=!1;break e;case 3:case 4:Dt=E.stateNode.containerInfo,On=!0;break e}E=E.return}if(Dt===null)throw Error(i(160));Fg(g,S,h),Dt=null,On=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)qg(r,t),r=r.sibling}var fr=null;function qg(t,r){var a=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:_n(r,t),Rn(t),o&4&&(dl(3,t,t.return),$a(3,t),dl(5,t,t.return));break;case 1:_n(r,t),Rn(t),o&512&&(Qt||a===null||vr(a,a.return)),o&64&&Br&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var h=fr;if(_n(r,t),Rn(t),o&512&&(Qt||a===null||vr(a,a.return)),o&4){var g=a!==null?a.memoizedState:null;if(o=t.memoizedState,a===null)if(o===null)if(t.stateNode===null){e:{o=t.type,a=t.memoizedProps,h=h.ownerDocument||h;t:switch(o){case"title":g=h.getElementsByTagName("title")[0],(!g||g[ga]||g[un]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(o),h.head.insertBefore(g,h.querySelector("head > title"))),pn(g,o,a),g[un]=t,sn(g),o=g;break e;case"link":var S=qx("link","href",h).get(o+(a.href||""));if(S){for(var E=0;E<S.length;E++)if(g=S[E],g.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&g.getAttribute("rel")===(a.rel==null?null:a.rel)&&g.getAttribute("title")===(a.title==null?null:a.title)&&g.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(E,1);break t}}g=h.createElement(o),pn(g,o,a),h.head.appendChild(g);break;case"meta":if(S=qx("meta","content",h).get(o+(a.content||""))){for(E=0;E<S.length;E++)if(g=S[E],g.getAttribute("content")===(a.content==null?null:""+a.content)&&g.getAttribute("name")===(a.name==null?null:a.name)&&g.getAttribute("property")===(a.property==null?null:a.property)&&g.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute("charset")===(a.charSet==null?null:a.charSet)){S.splice(E,1);break t}}g=h.createElement(o),pn(g,o,a),h.head.appendChild(g);break;default:throw Error(i(468,o))}g[un]=t,sn(g),o=g}t.stateNode=o}else Vx(h,t.type,t.stateNode);else t.stateNode=Gx(h,o,t.memoizedProps);else g!==o?(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,o===null?Vx(h,t.type,t.stateNode):Gx(h,o,t.memoizedProps)):o===null&&t.stateNode!==null&&hd(t,t.memoizedProps,a.memoizedProps)}break;case 27:_n(r,t),Rn(t),o&512&&(Qt||a===null||vr(a,a.return)),a!==null&&o&4&&hd(t,t.memoizedProps,a.memoizedProps);break;case 5:if(_n(r,t),Rn(t),o&512&&(Qt||a===null||vr(a,a.return)),t.flags&32){h=t.stateNode;try{yi(h,"")}catch(Ee){bt(t,t.return,Ee)}}o&4&&t.stateNode!=null&&(h=t.memoizedProps,hd(t,h,a!==null?a.memoizedProps:h)),o&1024&&(bd=!0);break;case 6:if(_n(r,t),Rn(t),o&4){if(t.stateNode===null)throw Error(i(162));o=t.memoizedProps,a=t.stateNode;try{a.nodeValue=o}catch(Ee){bt(t,t.return,Ee)}}break;case 3:if(Vo=null,h=fr,fr=Go(r.containerInfo),_n(r,t),fr=h,Rn(t),o&4&&a!==null&&a.memoizedState.isDehydrated)try{Zi(r.containerInfo)}catch(Ee){bt(t,t.return,Ee)}bd&&(bd=!1,Vg(t));break;case 4:o=fr,fr=Go(t.stateNode.containerInfo),_n(r,t),Rn(t),fr=o;break;case 12:_n(r,t),Rn(t);break;case 31:_n(r,t),Rn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Ao(t,o)));break;case 13:_n(r,t),Rn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(_o=Ot()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Ao(t,o)));break;case 22:h=t.memoizedState!==null;var F=a!==null&&a.memoizedState!==null,ne=Br,de=Qt;if(Br=ne||h,Qt=de||F,_n(r,t),Qt=de,Br=ne,Rn(t),o&8192)e:for(r=t.stateNode,r._visibility=h?r._visibility&-2:r._visibility|1,h&&(a===null||F||Br||Qt||Pl(t)),a=null,r=t;;){if(r.tag===5||r.tag===26){if(a===null){F=a=r;try{if(g=F.stateNode,h)S=g.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{E=F.stateNode;var pe=F.memoizedProps.style,ie=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;E.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(Ee){bt(F,F.return,Ee)}}}else if(r.tag===6){if(a===null){F=r;try{F.stateNode.nodeValue=h?"":F.memoizedProps}catch(Ee){bt(F,F.return,Ee)}}}else if(r.tag===18){if(a===null){F=r;try{var se=F.stateNode;h?zx(se,!0):zx(F.stateNode,!1)}catch(Ee){bt(F,F.return,Ee)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}o&4&&(o=t.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,Ao(t,a))));break;case 19:_n(r,t),Rn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Ao(t,o)));break;case 30:break;case 21:break;default:_n(r,t),Rn(t)}}function Rn(t){var r=t.flags;if(r&2){try{for(var a,o=t.return;o!==null;){if(Lg(o)){a=o;break}o=o.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var h=a.stateNode,g=gd(t);To(t,g,h);break;case 5:var S=a.stateNode;a.flags&32&&(yi(S,""),a.flags&=-33);var E=gd(t);To(t,E,S);break;case 3:case 4:var F=a.stateNode.containerInfo,ne=gd(t);xd(t,ne,F);break;default:throw Error(i(161))}}catch(de){bt(t,t.return,de)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function Vg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;Vg(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Ur(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Hg(t,r.alternate,r),r=r.sibling}function Pl(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:dl(4,r,r.return),Pl(r);break;case 1:vr(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&zg(r,r.return,a),Pl(r);break;case 27:Wa(r.stateNode);case 26:case 5:vr(r,r.return),Pl(r);break;case 22:r.memoizedState===null&&Pl(r);break;case 30:Pl(r);break;default:Pl(r)}t=t.sibling}}function Fr(t,r,a){for(a=a&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var o=r.alternate,h=t,g=r,S=g.flags;switch(g.tag){case 0:case 11:case 15:Fr(h,g,a),$a(4,g);break;case 1:if(Fr(h,g,a),o=g,h=o.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(ne){bt(o,o.return,ne)}if(o=g,h=o.updateQueue,h!==null){var E=o.stateNode;try{var F=h.shared.hiddenCallbacks;if(F!==null)for(h.shared.hiddenCallbacks=null,h=0;h<F.length;h++)wh(F[h],E)}catch(ne){bt(o,o.return,ne)}}a&&S&64&&Mg(g),Ga(g,g.return);break;case 27:Ig(g);case 26:case 5:Fr(h,g,a),a&&o===null&&S&4&&Dg(g),Ga(g,g.return);break;case 12:Fr(h,g,a);break;case 31:Fr(h,g,a),a&&S&4&&$g(h,g);break;case 13:Fr(h,g,a),a&&S&4&&Gg(h,g);break;case 22:g.memoizedState===null&&Fr(h,g,a),Ga(g,g.return);break;case 30:break;default:Fr(h,g,a)}r=r.sibling}}function yd(t,r){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Aa(a))}function vd(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Aa(t))}function mr(t,r,a,o){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Yg(t,r,a,o),r=r.sibling}function Yg(t,r,a,o){var h=r.flags;switch(r.tag){case 0:case 11:case 15:mr(t,r,a,o),h&2048&&$a(9,r);break;case 1:mr(t,r,a,o);break;case 3:mr(t,r,a,o),h&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Aa(t)));break;case 12:if(h&2048){mr(t,r,a,o),t=r.stateNode;try{var g=r.memoizedProps,S=g.id,E=g.onPostCommit;typeof E=="function"&&E(S,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(F){bt(r,r.return,F)}}else mr(t,r,a,o);break;case 31:mr(t,r,a,o);break;case 13:mr(t,r,a,o);break;case 23:break;case 22:g=r.stateNode,S=r.alternate,r.memoizedState!==null?g._visibility&2?mr(t,r,a,o):qa(t,r):g._visibility&2?mr(t,r,a,o):(g._visibility|=2,Hi(t,r,a,o,(r.subtreeFlags&10256)!==0||!1)),h&2048&&yd(S,r);break;case 24:mr(t,r,a,o),h&2048&&vd(r.alternate,r);break;default:mr(t,r,a,o)}}function Hi(t,r,a,o,h){for(h=h&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var g=t,S=r,E=a,F=o,ne=S.flags;switch(S.tag){case 0:case 11:case 15:Hi(g,S,E,F,h),$a(8,S);break;case 23:break;case 22:var de=S.stateNode;S.memoizedState!==null?de._visibility&2?Hi(g,S,E,F,h):qa(g,S):(de._visibility|=2,Hi(g,S,E,F,h)),h&&ne&2048&&yd(S.alternate,S);break;case 24:Hi(g,S,E,F,h),h&&ne&2048&&vd(S.alternate,S);break;default:Hi(g,S,E,F,h)}r=r.sibling}}function qa(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=t,o=r,h=o.flags;switch(o.tag){case 22:qa(a,o),h&2048&&yd(o.alternate,o);break;case 24:qa(a,o),h&2048&&vd(o.alternate,o);break;default:qa(a,o)}r=r.sibling}}var Va=8192;function Ui(t,r,a){if(t.subtreeFlags&Va)for(t=t.child;t!==null;)Xg(t,r,a),t=t.sibling}function Xg(t,r,a){switch(t.tag){case 26:Ui(t,r,a),t.flags&Va&&t.memoizedState!==null&&P2(a,fr,t.memoizedState,t.memoizedProps);break;case 5:Ui(t,r,a);break;case 3:case 4:var o=fr;fr=Go(t.stateNode.containerInfo),Ui(t,r,a),fr=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Va,Va=16777216,Ui(t,r,a),Va=o):Ui(t,r,a));break;default:Ui(t,r,a)}}function Pg(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function Ya(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var o=r[a];on=o,Zg(o,t)}Pg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Qg(t),t=t.sibling}function Qg(t){switch(t.tag){case 0:case 11:case 15:Ya(t),t.flags&2048&&dl(9,t,t.return);break;case 3:Ya(t);break;case 12:Ya(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Oo(t)):Ya(t);break;default:Ya(t)}}function Oo(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var o=r[a];on=o,Zg(o,t)}Pg(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:dl(8,r,r.return),Oo(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,Oo(r));break;default:Oo(r)}t=t.sibling}}function Zg(t,r){for(;on!==null;){var a=on;switch(a.tag){case 0:case 11:case 15:dl(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Aa(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,on=o;else e:for(a=t;on!==null;){o=on;var h=o.sibling,g=o.return;if(Ug(o),o===a){on=null;break e}if(h!==null){h.return=g,on=h;break e}on=g}}}var c2={getCacheForType:function(t){var r=fn(Yt),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a},cacheSignal:function(){return fn(Yt).controller.signal}},u2=typeof WeakMap=="function"?WeakMap:Map,pt=0,Nt=null,tt=null,lt=0,xt=0,Gn=null,fl=!1,Fi=!1,Sd=!1,$r=0,Ut=0,ml=0,Ql=0,wd=0,qn=0,$i=0,Xa=null,Mn=null,kd=!1,_o=0,Kg=0,Ro=1/0,Mo=null,pl=null,tn=0,hl=null,Gi=null,Gr=0,jd=0,Nd=null,Wg=null,Pa=0,Cd=null;function Vn(){return(pt&2)!==0&&lt!==0?lt&-lt:B.T!==null?Rd():pp()}function Jg(){if(qn===0)if((lt&536870912)===0||st){var t=Bt;Bt<<=1,(Bt&3932160)===0&&(Bt=262144),qn=t}else qn=536870912;return t=Fn.current,t!==null&&(t.flags|=32),qn}function zn(t,r,a){(t===Nt&&(xt===2||xt===9)||t.cancelPendingCommit!==null)&&(qi(t,0),gl(t,lt,qn,!1)),ha(t,a),((pt&2)===0||t!==Nt)&&(t===Nt&&((pt&2)===0&&(Ql|=a),Ut===4&&gl(t,lt,qn,!1)),Sr(t))}function ex(t,r,a){if((pt&6)!==0)throw Error(i(327));var o=!a&&(r&127)===0&&(r&t.expiredLanes)===0||pa(t,r),h=o?m2(t,r):Td(t,r,!0),g=o;do{if(h===0){Fi&&!o&&gl(t,r,0,!1);break}else{if(a=t.current.alternate,g&&!d2(a)){h=Td(t,r,!1),g=!1;continue}if(h===2){if(g=r,t.errorRecoveryDisabledLanes&g)var S=0;else S=t.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){r=S;e:{var E=t;h=Xa;var F=E.current.memoizedState.isDehydrated;if(F&&(qi(E,S).flags|=256),S=Td(E,S,!1),S!==2){if(Sd&&!F){E.errorRecoveryDisabledLanes|=g,Ql|=g,h=4;break e}g=Mn,Mn=h,g!==null&&(Mn===null?Mn=g:Mn.push.apply(Mn,g))}h=S}if(g=!1,h!==2)continue}}if(h===1){qi(t,0),gl(t,r,0,!0);break}e:{switch(o=t,g=h,g){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r)break;case 6:gl(o,r,qn,!fl);break e;case 2:Mn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(h=_o+300-Ot(),10<h)){if(gl(o,r,qn,!fl),fi(o,0,!0)!==0)break e;Gr=r,o.timeoutHandle=_x(tx.bind(null,o,a,Mn,Mo,kd,r,qn,Ql,$i,fl,g,"Throttled",-0,0),h);break e}tx(o,a,Mn,Mo,kd,r,qn,Ql,$i,fl,g,null,-0,0)}}break}while(!0);Sr(t)}function tx(t,r,a,o,h,g,S,E,F,ne,de,pe,ie,se){if(t.timeoutHandle=-1,pe=r.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Tr},Xg(r,g,pe);var Ee=(g&62914560)===g?_o-Ot():(g&4194048)===g?Kg-Ot():0;if(Ee=Q2(pe,Ee),Ee!==null){Gr=g,t.cancelPendingCommit=Ee(cx.bind(null,t,r,g,a,o,h,S,E,F,de,pe,null,ie,se)),gl(t,g,S,!ne);return}}cx(t,r,g,a,o,h,S,E,F)}function d2(t){for(var r=t;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var h=a[o],g=h.getSnapshot;h=h.value;try{if(!Hn(g(),h))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function gl(t,r,a,o){r&=~wd,r&=~Ql,t.suspendedLanes|=r,t.pingedLanes&=~r,o&&(t.warmLanes|=r),o=t.expirationTimes;for(var h=r;0<h;){var g=31-we(h),S=1<<g;o[g]=-1,h&=~S}a!==0&&dp(t,a,r)}function zo(){return(pt&6)===0?(Qa(0),!1):!0}function Ed(){if(tt!==null){if(xt===0)var t=tt.return;else t=tt,Rr=Ul=null,Gu(t),zi=null,_a=0,t=tt;for(;t!==null;)Rg(t.alternate,t),t=t.return;tt=null}}function qi(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,_2(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Gr=0,Ed(),Nt=t,tt=a=Or(t.current,null),lt=r,xt=0,Gn=null,fl=!1,Fi=pa(t,r),Sd=!1,$i=qn=wd=Ql=ml=Ut=0,Mn=Xa=null,kd=!1,(r&8)!==0&&(r|=r&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=r;0<o;){var h=31-we(o),g=1<<h;r|=t[h],o&=~g}return $r=r,eo(),a}function nx(t,r){Pe=null,B.H=Ha,r===Mi||r===oo?(r=bh(),xt=3):r===_u?(r=bh(),xt=4):xt=r===id?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Gn=r,tt===null&&(Ut=1,ko(t,tr(r,t.current)))}function rx(){var t=Fn.current;return t===null?!0:(lt&4194048)===lt?ir===null:(lt&62914560)===lt||(lt&536870912)!==0?t===ir:!1}function lx(){var t=B.H;return B.H=Ha,t===null?Ha:t}function ix(){var t=B.A;return B.A=c2,t}function Do(){Ut=4,fl||(lt&4194048)!==lt&&Fn.current!==null||(Fi=!0),(ml&134217727)===0&&(Ql&134217727)===0||Nt===null||gl(Nt,lt,qn,!1)}function Td(t,r,a){var o=pt;pt|=2;var h=lx(),g=ix();(Nt!==t||lt!==r)&&(Mo=null,qi(t,r)),r=!1;var S=Ut;e:do try{if(xt!==0&&tt!==null){var E=tt,F=Gn;switch(xt){case 8:Ed(),S=6;break e;case 3:case 2:case 9:case 6:Fn.current===null&&(r=!0);var ne=xt;if(xt=0,Gn=null,Vi(t,E,F,ne),a&&Fi){S=0;break e}break;default:ne=xt,xt=0,Gn=null,Vi(t,E,F,ne)}}f2(),S=Ut;break}catch(de){nx(t,de)}while(!0);return r&&t.shellSuspendCounter++,Rr=Ul=null,pt=o,B.H=h,B.A=g,tt===null&&(Nt=null,lt=0,eo()),S}function f2(){for(;tt!==null;)ax(tt)}function m2(t,r){var a=pt;pt|=2;var o=lx(),h=ix();Nt!==t||lt!==r?(Mo=null,Ro=Ot()+500,qi(t,r)):Fi=pa(t,r);e:do try{if(xt!==0&&tt!==null){r=tt;var g=Gn;t:switch(xt){case 1:xt=0,Gn=null,Vi(t,r,g,1);break;case 2:case 9:if(gh(g)){xt=0,Gn=null,sx(r);break}r=function(){xt!==2&&xt!==9||Nt!==t||(xt=7),Sr(t)},g.then(r,r);break e;case 3:xt=7;break e;case 4:xt=5;break e;case 7:gh(g)?(xt=0,Gn=null,sx(r)):(xt=0,Gn=null,Vi(t,r,g,7));break;case 5:var S=null;switch(tt.tag){case 26:S=tt.memoizedState;case 5:case 27:var E=tt;if(S?Yx(S):E.stateNode.complete){xt=0,Gn=null;var F=E.sibling;if(F!==null)tt=F;else{var ne=E.return;ne!==null?(tt=ne,Lo(ne)):tt=null}break t}}xt=0,Gn=null,Vi(t,r,g,5);break;case 6:xt=0,Gn=null,Vi(t,r,g,6);break;case 8:Ed(),Ut=6;break e;default:throw Error(i(462))}}p2();break}catch(de){nx(t,de)}while(!0);return Rr=Ul=null,B.H=o,B.A=h,pt=a,tt!==null?0:(Nt=null,lt=0,eo(),Ut)}function p2(){for(;tt!==null&&!en();)ax(tt)}function ax(t){var r=Og(t.alternate,t,$r);t.memoizedProps=t.pendingProps,r===null?Lo(t):tt=r}function sx(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=jg(a,r,r.pendingProps,r.type,void 0,lt);break;case 11:r=jg(a,r,r.pendingProps,r.type.render,r.ref,lt);break;case 5:Gu(r);default:Rg(a,r),r=tt=ih(r,$r),r=Og(a,r,$r)}t.memoizedProps=t.pendingProps,r===null?Lo(t):tt=r}function Vi(t,r,a,o){Rr=Ul=null,Gu(r),zi=null,_a=0;var h=r.return;try{if(n2(t,h,r,a,lt)){Ut=1,ko(t,tr(a,t.current)),tt=null;return}}catch(g){if(h!==null)throw tt=h,g;Ut=1,ko(t,tr(a,t.current)),tt=null;return}r.flags&32768?(st||o===1?t=!0:Fi||(lt&536870912)!==0?t=!1:(fl=t=!0,(o===2||o===9||o===3||o===6)&&(o=Fn.current,o!==null&&o.tag===13&&(o.flags|=16384))),ox(r,t)):Lo(r)}function Lo(t){var r=t;do{if((r.flags&32768)!==0){ox(r,fl);return}t=r.return;var a=i2(r.alternate,r,$r);if(a!==null){tt=a;return}if(r=r.sibling,r!==null){tt=r;return}tt=r=t}while(r!==null);Ut===0&&(Ut=5)}function ox(t,r){do{var a=a2(t.alternate,t);if(a!==null){a.flags&=32767,tt=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){tt=t;return}tt=t=a}while(t!==null);Ut=6,tt=null}function cx(t,r,a,o,h,g,S,E,F){t.cancelPendingCommit=null;do Io();while(tn!==0);if((pt&6)!==0)throw Error(i(327));if(r!==null){if(r===t.current)throw Error(i(177));if(g=r.lanes|r.childLanes,g|=gu,X1(t,a,g,S,E,F),t===Nt&&(tt=Nt=null,lt=0),Gi=r,hl=t,Gr=a,jd=g,Nd=h,Wg=o,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,b2(Me,function(){return px(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||o){o=B.T,B.T=null,h=P.p,P.p=2,S=pt,pt|=4;try{s2(t,r,a)}finally{pt=S,P.p=h,B.T=o}}tn=1,ux(),dx(),fx()}}function ux(){if(tn===1){tn=0;var t=hl,r=Gi,a=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||a){a=B.T,B.T=null;var o=P.p;P.p=2;var h=pt;pt|=4;try{qg(r,t);var g=Ud,S=Zp(t.containerInfo),E=g.focusedElem,F=g.selectionRange;if(S!==E&&E&&E.ownerDocument&&Qp(E.ownerDocument.documentElement,E)){if(F!==null&&du(E)){var ne=F.start,de=F.end;if(de===void 0&&(de=ne),"selectionStart"in E)E.selectionStart=ne,E.selectionEnd=Math.min(de,E.value.length);else{var pe=E.ownerDocument||document,ie=pe&&pe.defaultView||window;if(ie.getSelection){var se=ie.getSelection(),Ee=E.textContent.length,Be=Math.min(F.start,Ee),kt=F.end===void 0?Be:Math.min(F.end,Ee);!se.extend&&Be>kt&&(S=kt,kt=Be,Be=S);var J=Pp(E,Be),Z=Pp(E,kt);if(J&&Z&&(se.rangeCount!==1||se.anchorNode!==J.node||se.anchorOffset!==J.offset||se.focusNode!==Z.node||se.focusOffset!==Z.offset)){var te=pe.createRange();te.setStart(J.node,J.offset),se.removeAllRanges(),Be>kt?(se.addRange(te),se.extend(Z.node,Z.offset)):(te.setEnd(Z.node,Z.offset),se.addRange(te))}}}}for(pe=[],se=E;se=se.parentNode;)se.nodeType===1&&pe.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<pe.length;E++){var me=pe[E];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}Qo=!!Hd,Ud=Hd=null}finally{pt=h,P.p=o,B.T=a}}t.current=r,tn=2}}function dx(){if(tn===2){tn=0;var t=hl,r=Gi,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=B.T,B.T=null;var o=P.p;P.p=2;var h=pt;pt|=4;try{Hg(t,r.alternate,r)}finally{pt=h,P.p=o,B.T=a}}tn=3}}function fx(){if(tn===4||tn===3){tn=0,At();var t=hl,r=Gi,a=Gr,o=Wg;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?tn=5:(tn=0,Gi=hl=null,mx(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(pl=null),Yc(a),r=r.stateNode,ue&&typeof ue.onCommitFiberRoot=="function")try{ue.onCommitFiberRoot(Qe,r,void 0,(r.current.flags&128)===128)}catch{}if(o!==null){r=B.T,h=P.p,P.p=2,B.T=null;try{for(var g=t.onRecoverableError,S=0;S<o.length;S++){var E=o[S];g(E.value,{componentStack:E.stack})}}finally{B.T=r,P.p=h}}(Gr&3)!==0&&Io(),Sr(t),h=t.pendingLanes,(a&261930)!==0&&(h&42)!==0?t===Cd?Pa++:(Pa=0,Cd=t):Pa=0,Qa(0)}}function mx(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Aa(r)))}function Io(){return ux(),dx(),fx(),px()}function px(){if(tn!==5)return!1;var t=hl,r=jd;jd=0;var a=Yc(Gr),o=B.T,h=P.p;try{P.p=32>a?32:a,B.T=null,a=Nd,Nd=null;var g=hl,S=Gr;if(tn=0,Gi=hl=null,Gr=0,(pt&6)!==0)throw Error(i(331));var E=pt;if(pt|=4,Qg(g.current),Yg(g,g.current,S,a),pt=E,Qa(0,!1),ue&&typeof ue.onPostCommitFiberRoot=="function")try{ue.onPostCommitFiberRoot(Qe,g)}catch{}return!0}finally{P.p=h,B.T=o,mx(t,r)}}function hx(t,r,a){r=tr(a,r),r=ld(t.stateNode,r,2),t=ol(t,r,2),t!==null&&(ha(t,2),Sr(t))}function bt(t,r,a){if(t.tag===3)hx(t,t,a);else for(;r!==null;){if(r.tag===3){hx(r,t,a);break}else if(r.tag===1){var o=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(pl===null||!pl.has(o))){t=tr(a,t),a=gg(2),o=ol(r,a,2),o!==null&&(xg(a,o,r,t),ha(o,2),Sr(o));break}}r=r.return}}function Ad(t,r,a){var o=t.pingCache;if(o===null){o=t.pingCache=new u2;var h=new Set;o.set(r,h)}else h=o.get(r),h===void 0&&(h=new Set,o.set(r,h));h.has(a)||(Sd=!0,h.add(a),t=h2.bind(null,t,r,a),r.then(t,t))}function h2(t,r,a){var o=t.pingCache;o!==null&&o.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Nt===t&&(lt&a)===a&&(Ut===4||Ut===3&&(lt&62914560)===lt&&300>Ot()-_o?(pt&2)===0&&qi(t,0):wd|=a,$i===lt&&($i=0)),Sr(t)}function gx(t,r){r===0&&(r=up()),t=Il(t,r),t!==null&&(ha(t,r),Sr(t))}function g2(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),gx(t,a)}function x2(t,r){var a=0;switch(t.tag){case 31:case 13:var o=t.stateNode,h=t.memoizedState;h!==null&&(a=h.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(i(314))}o!==null&&o.delete(r),gx(t,a)}function b2(t,r){return Tt(t,r)}var Bo=null,Yi=null,Od=!1,Ho=!1,_d=!1,xl=0;function Sr(t){t!==Yi&&t.next===null&&(Yi===null?Bo=Yi=t:Yi=Yi.next=t),Ho=!0,Od||(Od=!0,v2())}function Qa(t,r){if(!_d&&Ho){_d=!0;do for(var a=!1,o=Bo;o!==null;){if(t!==0){var h=o.pendingLanes;if(h===0)var g=0;else{var S=o.suspendedLanes,E=o.pingedLanes;g=(1<<31-we(42|t)+1)-1,g&=h&~(S&~E),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,vx(o,g))}else g=lt,g=fi(o,o===Nt?g:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(g&3)===0||pa(o,g)||(a=!0,vx(o,g));o=o.next}while(a);_d=!1}}function y2(){xx()}function xx(){Ho=Od=!1;var t=0;xl!==0&&O2()&&(t=xl);for(var r=Ot(),a=null,o=Bo;o!==null;){var h=o.next,g=bx(o,r);g===0?(o.next=null,a===null?Bo=h:a.next=h,h===null&&(Yi=a)):(a=o,(t!==0||(g&3)!==0)&&(Ho=!0)),o=h}tn!==0&&tn!==5||Qa(t),xl!==0&&(xl=0)}function bx(t,r){for(var a=t.suspendedLanes,o=t.pingedLanes,h=t.expirationTimes,g=t.pendingLanes&-62914561;0<g;){var S=31-we(g),E=1<<S,F=h[S];F===-1?((E&a)===0||(E&o)!==0)&&(h[S]=Y1(E,r)):F<=r&&(t.expiredLanes|=E),g&=~E}if(r=Nt,a=lt,a=fi(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,a===0||t===r&&(xt===2||xt===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&Gt(o),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||pa(t,a)){if(r=a&-a,r===t.callbackPriority)return r;switch(o!==null&&Gt(o),Yc(a)){case 2:case 8:a=ve;break;case 32:a=Me;break;case 268435456:a=Se;break;default:a=Me}return o=yx.bind(null,t),a=Tt(a,o),t.callbackPriority=r,t.callbackNode=a,r}return o!==null&&o!==null&&Gt(o),t.callbackPriority=2,t.callbackNode=null,2}function yx(t,r){if(tn!==0&&tn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Io()&&t.callbackNode!==a)return null;var o=lt;return o=fi(t,t===Nt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(ex(t,o,r),bx(t,Ot()),t.callbackNode!=null&&t.callbackNode===a?yx.bind(null,t):null)}function vx(t,r){if(Io())return null;ex(t,r,!0)}function v2(){R2(function(){(pt&6)!==0?Tt(ce,y2):xx()})}function Rd(){if(xl===0){var t=_i;t===0&&(t=qt,qt<<=1,(qt&261888)===0&&(qt=256)),xl=t}return xl}function Sx(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ys(""+t)}function wx(t,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,t.id&&a.setAttribute("form",t.id),r.parentNode.insertBefore(a,r),t=new FormData(t),a.parentNode.removeChild(a),t}function S2(t,r,a,o,h){if(r==="submit"&&a&&a.stateNode===h){var g=Sx((h[Tn]||null).action),S=o.submitter;S&&(r=(r=S[Tn]||null)?Sx(r.formAction):S.getAttribute("formAction"),r!==null&&(g=r,S=null));var E=new Zs("action","action",null,o,h);t.push({event:E,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(xl!==0){var F=S?wx(h,S):new FormData(h);Wu(a,{pending:!0,data:F,method:h.method,action:g},null,F)}}else typeof g=="function"&&(E.preventDefault(),F=S?wx(h,S):new FormData(h),Wu(a,{pending:!0,data:F,method:h.method,action:g},g,F))},currentTarget:h}]})}}for(var Md=0;Md<hu.length;Md++){var zd=hu[Md],w2=zd.toLowerCase(),k2=zd[0].toUpperCase()+zd.slice(1);dr(w2,"on"+k2)}dr(Jp,"onAnimationEnd"),dr(eh,"onAnimationIteration"),dr(th,"onAnimationStart"),dr("dblclick","onDoubleClick"),dr("focusin","onFocus"),dr("focusout","onBlur"),dr(HS,"onTransitionRun"),dr(US,"onTransitionStart"),dr(FS,"onTransitionCancel"),dr(nh,"onTransitionEnd"),xi("onMouseEnter",["mouseout","mouseover"]),xi("onMouseLeave",["mouseout","mouseover"]),xi("onPointerEnter",["pointerout","pointerover"]),xi("onPointerLeave",["pointerout","pointerover"]),Ml("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ml("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ml("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ml("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ml("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ml("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Za="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),j2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Za));function kx(t,r){r=(r&4)!==0;for(var a=0;a<t.length;a++){var o=t[a],h=o.event;o=o.listeners;e:{var g=void 0;if(r)for(var S=o.length-1;0<=S;S--){var E=o[S],F=E.instance,ne=E.currentTarget;if(E=E.listener,F!==g&&h.isPropagationStopped())break e;g=E,h.currentTarget=ne;try{g(h)}catch(de){Js(de)}h.currentTarget=null,g=F}else for(S=0;S<o.length;S++){if(E=o[S],F=E.instance,ne=E.currentTarget,E=E.listener,F!==g&&h.isPropagationStopped())break e;g=E,h.currentTarget=ne;try{g(h)}catch(de){Js(de)}h.currentTarget=null,g=F}}}}function nt(t,r){var a=r[Xc];a===void 0&&(a=r[Xc]=new Set);var o=t+"__bubble";a.has(o)||(jx(r,t,2,!1),a.add(o))}function Dd(t,r,a){var o=0;r&&(o|=4),jx(a,t,o,r)}var Uo="_reactListening"+Math.random().toString(36).slice(2);function Ld(t){if(!t[Uo]){t[Uo]=!0,xp.forEach(function(a){a!=="selectionchange"&&(j2.has(a)||Dd(a,!1,t),Dd(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Uo]||(r[Uo]=!0,Dd("selectionchange",!1,r))}}function jx(t,r,a,o){switch(Jx(r)){case 2:var h=W2;break;case 8:h=J2;break;default:h=Kd}a=h.bind(null,r,a,t),h=void 0,!nu||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(h=!0),o?h!==void 0?t.addEventListener(r,a,{capture:!0,passive:h}):t.addEventListener(r,a,!0):h!==void 0?t.addEventListener(r,a,{passive:h}):t.addEventListener(r,a,!1)}function Id(t,r,a,o,h){var g=o;if((r&1)===0&&(r&2)===0&&o!==null)e:for(;;){if(o===null)return;var S=o.tag;if(S===3||S===4){var E=o.stateNode.containerInfo;if(E===h)break;if(S===4)for(S=o.return;S!==null;){var F=S.tag;if((F===3||F===4)&&S.stateNode.containerInfo===h)return;S=S.return}for(;E!==null;){if(S=pi(E),S===null)return;if(F=S.tag,F===5||F===6||F===26||F===27){o=g=S;continue e}E=E.parentNode}}o=o.return}Ap(function(){var ne=g,de=eu(a),pe=[];e:{var ie=rh.get(t);if(ie!==void 0){var se=Zs,Ee=t;switch(t){case"keypress":if(Ps(a)===0)break e;case"keydown":case"keyup":se=xS;break;case"focusin":Ee="focus",se=au;break;case"focusout":Ee="blur",se=au;break;case"beforeblur":case"afterblur":se=au;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=Rp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=iS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=vS;break;case Jp:case eh:case th:se=oS;break;case nh:se=wS;break;case"scroll":case"scrollend":se=rS;break;case"wheel":se=jS;break;case"copy":case"cut":case"paste":se=uS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=zp;break;case"toggle":case"beforetoggle":se=CS}var Be=(r&4)!==0,kt=!Be&&(t==="scroll"||t==="scrollend"),J=Be?ie!==null?ie+"Capture":null:ie;Be=[];for(var Z=ne,te;Z!==null;){var me=Z;if(te=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||te===null||J===null||(me=ba(Z,J),me!=null&&Be.push(Ka(Z,me,te))),kt)break;Z=Z.return}0<Be.length&&(ie=new se(ie,Ee,null,a,de),pe.push({event:ie,listeners:Be}))}}if((r&7)===0){e:{if(ie=t==="mouseover"||t==="pointerover",se=t==="mouseout"||t==="pointerout",ie&&a!==Jc&&(Ee=a.relatedTarget||a.fromElement)&&(pi(Ee)||Ee[mi]))break e;if((se||ie)&&(ie=de.window===de?de:(ie=de.ownerDocument)?ie.defaultView||ie.parentWindow:window,se?(Ee=a.relatedTarget||a.toElement,se=ne,Ee=Ee?pi(Ee):null,Ee!==null&&(kt=c(Ee),Be=Ee.tag,Ee!==kt||Be!==5&&Be!==27&&Be!==6)&&(Ee=null)):(se=null,Ee=ne),se!==Ee)){if(Be=Rp,me="onMouseLeave",J="onMouseEnter",Z="mouse",(t==="pointerout"||t==="pointerover")&&(Be=zp,me="onPointerLeave",J="onPointerEnter",Z="pointer"),kt=se==null?ie:xa(se),te=Ee==null?ie:xa(Ee),ie=new Be(me,Z+"leave",se,a,de),ie.target=kt,ie.relatedTarget=te,me=null,pi(de)===ne&&(Be=new Be(J,Z+"enter",Ee,a,de),Be.target=te,Be.relatedTarget=kt,me=Be),kt=me,se&&Ee)t:{for(Be=N2,J=se,Z=Ee,te=0,me=J;me;me=Be(me))te++;me=0;for(var ze=Z;ze;ze=Be(ze))me++;for(;0<te-me;)J=Be(J),te--;for(;0<me-te;)Z=Be(Z),me--;for(;te--;){if(J===Z||Z!==null&&J===Z.alternate){Be=J;break t}J=Be(J),Z=Be(Z)}Be=null}else Be=null;se!==null&&Nx(pe,ie,se,Be,!1),Ee!==null&&kt!==null&&Nx(pe,kt,Ee,Be,!0)}}e:{if(ie=ne?xa(ne):window,se=ie.nodeName&&ie.nodeName.toLowerCase(),se==="select"||se==="input"&&ie.type==="file")var dt=$p;else if(Up(ie))if(Gp)dt=LS;else{dt=zS;var Oe=MS}else se=ie.nodeName,!se||se.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ne&&Wc(ne.elementType)&&(dt=$p):dt=DS;if(dt&&(dt=dt(t,ne))){Fp(pe,dt,a,de);break e}Oe&&Oe(t,ie,ne),t==="focusout"&&ne&&ie.type==="number"&&ne.memoizedProps.value!=null&&Kc(ie,"number",ie.value)}switch(Oe=ne?xa(ne):window,t){case"focusin":(Up(Oe)||Oe.contentEditable==="true")&&(ki=Oe,fu=ne,Ca=null);break;case"focusout":Ca=fu=ki=null;break;case"mousedown":mu=!0;break;case"contextmenu":case"mouseup":case"dragend":mu=!1,Kp(pe,a,de);break;case"selectionchange":if(BS)break;case"keydown":case"keyup":Kp(pe,a,de)}var Ze;if(ou)e:{switch(t){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else wi?Bp(t,a)&&(it="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(it="onCompositionStart");it&&(Dp&&a.locale!=="ko"&&(wi||it!=="onCompositionStart"?it==="onCompositionEnd"&&wi&&(Ze=Op()):(tl=de,ru="value"in tl?tl.value:tl.textContent,wi=!0)),Oe=Fo(ne,it),0<Oe.length&&(it=new Mp(it,t,null,a,de),pe.push({event:it,listeners:Oe}),Ze?it.data=Ze:(Ze=Hp(a),Ze!==null&&(it.data=Ze)))),(Ze=TS?AS(t,a):OS(t,a))&&(it=Fo(ne,"onBeforeInput"),0<it.length&&(Oe=new Mp("onBeforeInput","beforeinput",null,a,de),pe.push({event:Oe,listeners:it}),Oe.data=Ze)),S2(pe,t,ne,a,de)}kx(pe,r)})}function Ka(t,r,a){return{instance:t,listener:r,currentTarget:a}}function Fo(t,r){for(var a=r+"Capture",o=[];t!==null;){var h=t,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=ba(t,a),h!=null&&o.unshift(Ka(t,h,g)),h=ba(t,r),h!=null&&o.push(Ka(t,h,g))),t.tag===3)return o;t=t.return}return[]}function N2(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Nx(t,r,a,o,h){for(var g=r._reactName,S=[];a!==null&&a!==o;){var E=a,F=E.alternate,ne=E.stateNode;if(E=E.tag,F!==null&&F===o)break;E!==5&&E!==26&&E!==27||ne===null||(F=ne,h?(ne=ba(a,g),ne!=null&&S.unshift(Ka(a,ne,F))):h||(ne=ba(a,g),ne!=null&&S.push(Ka(a,ne,F)))),a=a.return}S.length!==0&&t.push({event:r,listeners:S})}var C2=/\r\n?/g,E2=/\u0000|\uFFFD/g;function Cx(t){return(typeof t=="string"?t:""+t).replace(C2,`
49
- `).replace(E2,"")}function Ex(t,r){return r=Cx(r),Cx(t)===r}function wt(t,r,a,o,h,g){switch(a){case"children":typeof o=="string"?r==="body"||r==="textarea"&&o===""||yi(t,o):(typeof o=="number"||typeof o=="bigint")&&r!=="body"&&yi(t,""+o);break;case"className":qs(t,"class",o);break;case"tabIndex":qs(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":qs(t,a,o);break;case"style":Ep(t,o,g);break;case"data":if(r!=="object"){qs(t,"data",o);break}case"src":case"href":if(o===""&&(r!=="a"||a!=="href")){t.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(a);break}o=Ys(""+o),t.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(a==="formAction"?(r!=="input"&&wt(t,r,"name",h.name,h,null),wt(t,r,"formEncType",h.formEncType,h,null),wt(t,r,"formMethod",h.formMethod,h,null),wt(t,r,"formTarget",h.formTarget,h,null)):(wt(t,r,"encType",h.encType,h,null),wt(t,r,"method",h.method,h,null),wt(t,r,"target",h.target,h,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(a);break}o=Ys(""+o),t.setAttribute(a,o);break;case"onClick":o!=null&&(t.onclick=Tr);break;case"onScroll":o!=null&&nt("scroll",t);break;case"onScrollEnd":o!=null&&nt("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(a=o.__html,a!=null){if(h.children!=null)throw Error(i(60));t.innerHTML=a}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}a=Ys(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,""+o):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":o===!0?t.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,o):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(a,o):t.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(a):t.setAttribute(a,o);break;case"popover":nt("beforetoggle",t),nt("toggle",t),Gs(t,"popover",o);break;case"xlinkActuate":Er(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Er(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Er(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Er(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Er(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Er(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Er(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Er(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Er(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Gs(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=tS.get(a)||a,Gs(t,a,o))}}function Bd(t,r,a,o,h,g){switch(a){case"style":Ep(t,o,g);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(a=o.__html,a!=null){if(h.children!=null)throw Error(i(60));t.innerHTML=a}}break;case"children":typeof o=="string"?yi(t,o):(typeof o=="number"||typeof o=="bigint")&&yi(t,""+o);break;case"onScroll":o!=null&&nt("scroll",t);break;case"onScrollEnd":o!=null&&nt("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Tr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!bp.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(h=a.endsWith("Capture"),r=a.slice(2,h?a.length-7:void 0),g=t[Tn]||null,g=g!=null?g[a]:null,typeof g=="function"&&t.removeEventListener(r,g,h),typeof o=="function")){typeof g!="function"&&g!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(r,o,h);break e}a in t?t[a]=o:o===!0?t.setAttribute(a,""):Gs(t,a,o)}}}function pn(t,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":nt("error",t),nt("load",t);var o=!1,h=!1,g;for(g in a)if(a.hasOwnProperty(g)){var S=a[g];if(S!=null)switch(g){case"src":o=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:wt(t,r,g,S,a,null)}}h&&wt(t,r,"srcSet",a.srcSet,a,null),o&&wt(t,r,"src",a.src,a,null);return;case"input":nt("invalid",t);var E=g=S=h=null,F=null,ne=null;for(o in a)if(a.hasOwnProperty(o)){var de=a[o];if(de!=null)switch(o){case"name":h=de;break;case"type":S=de;break;case"checked":F=de;break;case"defaultChecked":ne=de;break;case"value":g=de;break;case"defaultValue":E=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(i(137,r));break;default:wt(t,r,o,de,a,null)}}kp(t,g,E,F,ne,S,h,!1);return;case"select":nt("invalid",t),o=S=g=null;for(h in a)if(a.hasOwnProperty(h)&&(E=a[h],E!=null))switch(h){case"value":g=E;break;case"defaultValue":S=E;break;case"multiple":o=E;default:wt(t,r,h,E,a,null)}r=g,a=S,t.multiple=!!o,r!=null?bi(t,!!o,r,!1):a!=null&&bi(t,!!o,a,!0);return;case"textarea":nt("invalid",t),g=h=o=null;for(S in a)if(a.hasOwnProperty(S)&&(E=a[S],E!=null))switch(S){case"value":o=E;break;case"defaultValue":h=E;break;case"children":g=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(i(91));break;default:wt(t,r,S,E,a,null)}Np(t,o,h,g);return;case"option":for(F in a)if(a.hasOwnProperty(F)&&(o=a[F],o!=null))switch(F){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:wt(t,r,F,o,a,null)}return;case"dialog":nt("beforetoggle",t),nt("toggle",t),nt("cancel",t),nt("close",t);break;case"iframe":case"object":nt("load",t);break;case"video":case"audio":for(o=0;o<Za.length;o++)nt(Za[o],t);break;case"image":nt("error",t),nt("load",t);break;case"details":nt("toggle",t);break;case"embed":case"source":case"link":nt("error",t),nt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in a)if(a.hasOwnProperty(ne)&&(o=a[ne],o!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:wt(t,r,ne,o,a,null)}return;default:if(Wc(r)){for(de in a)a.hasOwnProperty(de)&&(o=a[de],o!==void 0&&Bd(t,r,de,o,a,void 0));return}}for(E in a)a.hasOwnProperty(E)&&(o=a[E],o!=null&&wt(t,r,E,o,a,null))}function T2(t,r,a,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,S=null,E=null,F=null,ne=null,de=null;for(se in a){var pe=a[se];if(a.hasOwnProperty(se)&&pe!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":F=pe;default:o.hasOwnProperty(se)||wt(t,r,se,null,o,pe)}}for(var ie in o){var se=o[ie];if(pe=a[ie],o.hasOwnProperty(ie)&&(se!=null||pe!=null))switch(ie){case"type":g=se;break;case"name":h=se;break;case"checked":ne=se;break;case"defaultChecked":de=se;break;case"value":S=se;break;case"defaultValue":E=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(i(137,r));break;default:se!==pe&&wt(t,r,ie,se,o,pe)}}Zc(t,S,E,F,ne,de,g,h);return;case"select":se=S=E=ie=null;for(g in a)if(F=a[g],a.hasOwnProperty(g)&&F!=null)switch(g){case"value":break;case"multiple":se=F;default:o.hasOwnProperty(g)||wt(t,r,g,null,o,F)}for(h in o)if(g=o[h],F=a[h],o.hasOwnProperty(h)&&(g!=null||F!=null))switch(h){case"value":ie=g;break;case"defaultValue":E=g;break;case"multiple":S=g;default:g!==F&&wt(t,r,h,g,o,F)}r=E,a=S,o=se,ie!=null?bi(t,!!a,ie,!1):!!o!=!!a&&(r!=null?bi(t,!!a,r,!0):bi(t,!!a,a?[]:"",!1));return;case"textarea":se=ie=null;for(E in a)if(h=a[E],a.hasOwnProperty(E)&&h!=null&&!o.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:wt(t,r,E,null,o,h)}for(S in o)if(h=o[S],g=a[S],o.hasOwnProperty(S)&&(h!=null||g!=null))switch(S){case"value":ie=h;break;case"defaultValue":se=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(i(91));break;default:h!==g&&wt(t,r,S,h,o,g)}jp(t,ie,se);return;case"option":for(var Ee in a)if(ie=a[Ee],a.hasOwnProperty(Ee)&&ie!=null&&!o.hasOwnProperty(Ee))switch(Ee){case"selected":t.selected=!1;break;default:wt(t,r,Ee,null,o,ie)}for(F in o)if(ie=o[F],se=a[F],o.hasOwnProperty(F)&&ie!==se&&(ie!=null||se!=null))switch(F){case"selected":t.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:wt(t,r,F,ie,o,se)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Be in a)ie=a[Be],a.hasOwnProperty(Be)&&ie!=null&&!o.hasOwnProperty(Be)&&wt(t,r,Be,null,o,ie);for(ne in o)if(ie=o[ne],se=a[ne],o.hasOwnProperty(ne)&&ie!==se&&(ie!=null||se!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,r));break;default:wt(t,r,ne,ie,o,se)}return;default:if(Wc(r)){for(var kt in a)ie=a[kt],a.hasOwnProperty(kt)&&ie!==void 0&&!o.hasOwnProperty(kt)&&Bd(t,r,kt,void 0,o,ie);for(de in o)ie=o[de],se=a[de],!o.hasOwnProperty(de)||ie===se||ie===void 0&&se===void 0||Bd(t,r,de,ie,o,se);return}}for(var J in a)ie=a[J],a.hasOwnProperty(J)&&ie!=null&&!o.hasOwnProperty(J)&&wt(t,r,J,null,o,ie);for(pe in o)ie=o[pe],se=a[pe],!o.hasOwnProperty(pe)||ie===se||ie==null&&se==null||wt(t,r,pe,ie,o,se)}function Tx(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function A2(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var h=a[o],g=h.transferSize,S=h.initiatorType,E=h.duration;if(g&&E&&Tx(S)){for(S=0,E=h.responseEnd,o+=1;o<a.length;o++){var F=a[o],ne=F.startTime;if(ne>E)break;var de=F.transferSize,pe=F.initiatorType;de&&Tx(pe)&&(F=F.responseEnd,S+=de*(F<E?1:(E-ne)/(F-ne)))}if(--o,r+=8*(g+S)/(h.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Hd=null,Ud=null;function $o(t){return t.nodeType===9?t:t.ownerDocument}function Ax(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ox(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function Fd(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var $d=null;function O2(){var t=window.event;return t&&t.type==="popstate"?t===$d?!1:($d=t,!0):($d=null,!1)}var _x=typeof setTimeout=="function"?setTimeout:void 0,_2=typeof clearTimeout=="function"?clearTimeout:void 0,Rx=typeof Promise=="function"?Promise:void 0,R2=typeof queueMicrotask=="function"?queueMicrotask:typeof Rx<"u"?function(t){return Rx.resolve(null).then(t).catch(M2)}:_x;function M2(t){setTimeout(function(){throw t})}function bl(t){return t==="head"}function Mx(t,r){var a=r,o=0;do{var h=a.nextSibling;if(t.removeChild(a),h&&h.nodeType===8)if(a=h.data,a==="/$"||a==="/&"){if(o===0){t.removeChild(h),Zi(r);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")Wa(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Wa(a);for(var g=a.firstChild;g;){var S=g.nextSibling,E=g.nodeName;g[ga]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&g.rel.toLowerCase()==="stylesheet"||a.removeChild(g),g=S}}else a==="body"&&Wa(t.ownerDocument.body);a=h}while(a);Zi(r)}function zx(t,r){var a=t;t=0;do{var o=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=o}while(a)}function Gd(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Gd(a),Pc(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function z2(t,r,a,o){for(;t.nodeType===1;){var h=a;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[ga])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(g=t.getAttribute("rel"),g==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(g!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(g=t.getAttribute("src"),(g!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===g)return t}else return t;if(t=ar(t.nextSibling),t===null)break}return null}function D2(t,r,a){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=ar(t.nextSibling),t===null))return null;return t}function Dx(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=ar(t.nextSibling),t===null))return null;return t}function qd(t){return t.data==="$?"||t.data==="$~"}function Vd(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function L2(t,r){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||a.readyState!=="loading")r();else{var o=function(){r(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function ar(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var Yd=null;function Lx(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(r===0)return ar(t.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}t=t.nextSibling}return null}function Ix(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return t;r--}else a!=="/$"&&a!=="/&"||r++}t=t.previousSibling}return null}function Bx(t,r,a){switch(r=$o(a),t){case"html":if(t=r.documentElement,!t)throw Error(i(452));return t;case"head":if(t=r.head,!t)throw Error(i(453));return t;case"body":if(t=r.body,!t)throw Error(i(454));return t;default:throw Error(i(451))}}function Wa(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Pc(t)}var sr=new Map,Hx=new Set;function Go(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var qr=P.d;P.d={f:I2,r:B2,D:H2,C:U2,L:F2,m:$2,X:q2,S:G2,M:V2};function I2(){var t=qr.f(),r=zo();return t||r}function B2(t){var r=hi(t);r!==null&&r.tag===5&&r.type==="form"?ng(r):qr.r(t)}var Xi=typeof document>"u"?null:document;function Ux(t,r,a){var o=Xi;if(o&&typeof r=="string"&&r){var h=Jn(r);h='link[rel="'+t+'"][href="'+h+'"]',typeof a=="string"&&(h+='[crossorigin="'+a+'"]'),Hx.has(h)||(Hx.add(h),t={rel:t,crossOrigin:a,href:r},o.querySelector(h)===null&&(r=o.createElement("link"),pn(r,"link",t),sn(r),o.head.appendChild(r)))}}function H2(t){qr.D(t),Ux("dns-prefetch",t,null)}function U2(t,r){qr.C(t,r),Ux("preconnect",t,r)}function F2(t,r,a){qr.L(t,r,a);var o=Xi;if(o&&t&&r){var h='link[rel="preload"][as="'+Jn(r)+'"]';r==="image"&&a&&a.imageSrcSet?(h+='[imagesrcset="'+Jn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(h+='[imagesizes="'+Jn(a.imageSizes)+'"]')):h+='[href="'+Jn(t)+'"]';var g=h;switch(r){case"style":g=Pi(t);break;case"script":g=Qi(t)}sr.has(g)||(t=b({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),sr.set(g,t),o.querySelector(h)!==null||r==="style"&&o.querySelector(Ja(g))||r==="script"&&o.querySelector(es(g))||(r=o.createElement("link"),pn(r,"link",t),sn(r),o.head.appendChild(r)))}}function $2(t,r){qr.m(t,r);var a=Xi;if(a&&t){var o=r&&typeof r.as=="string"?r.as:"script",h='link[rel="modulepreload"][as="'+Jn(o)+'"][href="'+Jn(t)+'"]',g=h;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Qi(t)}if(!sr.has(g)&&(t=b({rel:"modulepreload",href:t},r),sr.set(g,t),a.querySelector(h)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(es(g)))return}o=a.createElement("link"),pn(o,"link",t),sn(o),a.head.appendChild(o)}}}function G2(t,r,a){qr.S(t,r,a);var o=Xi;if(o&&t){var h=gi(o).hoistableStyles,g=Pi(t);r=r||"default";var S=h.get(g);if(!S){var E={loading:0,preload:null};if(S=o.querySelector(Ja(g)))E.loading=5;else{t=b({rel:"stylesheet",href:t,"data-precedence":r},a),(a=sr.get(g))&&Xd(t,a);var F=S=o.createElement("link");sn(F),pn(F,"link",t),F._p=new Promise(function(ne,de){F.onload=ne,F.onerror=de}),F.addEventListener("load",function(){E.loading|=1}),F.addEventListener("error",function(){E.loading|=2}),E.loading|=4,qo(S,r,o)}S={type:"stylesheet",instance:S,count:1,state:E},h.set(g,S)}}}function q2(t,r){qr.X(t,r);var a=Xi;if(a&&t){var o=gi(a).hoistableScripts,h=Qi(t),g=o.get(h);g||(g=a.querySelector(es(h)),g||(t=b({src:t,async:!0},r),(r=sr.get(h))&&Pd(t,r),g=a.createElement("script"),sn(g),pn(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},o.set(h,g))}}function V2(t,r){qr.M(t,r);var a=Xi;if(a&&t){var o=gi(a).hoistableScripts,h=Qi(t),g=o.get(h);g||(g=a.querySelector(es(h)),g||(t=b({src:t,async:!0,type:"module"},r),(r=sr.get(h))&&Pd(t,r),g=a.createElement("script"),sn(g),pn(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},o.set(h,g))}}function Fx(t,r,a,o){var h=(h=re.current)?Go(h):null;if(!h)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=Pi(a.href),a=gi(h).hoistableStyles,o=a.get(r),o||(o={type:"style",instance:null,count:0,state:null},a.set(r,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Pi(a.href);var g=gi(h).hoistableStyles,S=g.get(t);if(S||(h=h.ownerDocument||h,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(t,S),(g=h.querySelector(Ja(t)))&&!g._p&&(S.instance=g,S.state.loading=5),sr.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},sr.set(t,a),g||Y2(h,t,a,S.state))),r&&o===null)throw Error(i(528,""));return S}if(r&&o!==null)throw Error(i(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Qi(a),a=gi(h).hoistableScripts,o=a.get(r),o||(o={type:"script",instance:null,count:0,state:null},a.set(r,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function Pi(t){return'href="'+Jn(t)+'"'}function Ja(t){return'link[rel="stylesheet"]['+t+"]"}function $x(t){return b({},t,{"data-precedence":t.precedence,precedence:null})}function Y2(t,r,a,o){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?o.loading=1:(r=t.createElement("link"),o.preload=r,r.addEventListener("load",function(){return o.loading|=1}),r.addEventListener("error",function(){return o.loading|=2}),pn(r,"link",a),sn(r),t.head.appendChild(r))}function Qi(t){return'[src="'+Jn(t)+'"]'}function es(t){return"script[async]"+t}function Gx(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var o=t.querySelector('style[data-href~="'+Jn(a.href)+'"]');if(o)return r.instance=o,sn(o),o;var h=b({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),sn(o),pn(o,"style",h),qo(o,a.precedence,t),r.instance=o;case"stylesheet":h=Pi(a.href);var g=t.querySelector(Ja(h));if(g)return r.state.loading|=4,r.instance=g,sn(g),g;o=$x(a),(h=sr.get(h))&&Xd(o,h),g=(t.ownerDocument||t).createElement("link"),sn(g);var S=g;return S._p=new Promise(function(E,F){S.onload=E,S.onerror=F}),pn(g,"link",o),r.state.loading|=4,qo(g,a.precedence,t),r.instance=g;case"script":return g=Qi(a.src),(h=t.querySelector(es(g)))?(r.instance=h,sn(h),h):(o=a,(h=sr.get(g))&&(o=b({},a),Pd(o,h)),t=t.ownerDocument||t,h=t.createElement("script"),sn(h),pn(h,"link",o),t.head.appendChild(h),r.instance=h);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(o=r.instance,r.state.loading|=4,qo(o,a.precedence,t));return r.instance}function qo(t,r,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=o.length?o[o.length-1]:null,g=h,S=0;S<o.length;S++){var E=o[S];if(E.dataset.precedence===r)g=E;else if(g!==h)break}g?g.parentNode.insertBefore(t,g.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(t,r.firstChild))}function Xd(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Pd(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var Vo=null;function qx(t,r,a){if(Vo===null){var o=new Map,h=Vo=new Map;h.set(a,o)}else h=Vo,o=h.get(a),o||(o=new Map,h.set(a,o));if(o.has(t))return o;for(o.set(t,null),a=a.getElementsByTagName(t),h=0;h<a.length;h++){var g=a[h];if(!(g[ga]||g[un]||t==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var S=g.getAttribute(r)||"";S=t+S;var E=o.get(S);E?E.push(g):o.set(S,[g])}}return o}function Vx(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function X2(t,r,a){if(a===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Yx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function P2(t,r,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var h=Pi(o.href),g=r.querySelector(Ja(h));if(g){r=g._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Yo.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=g,sn(g);return}g=r.ownerDocument||r,o=$x(o),(h=sr.get(h))&&Xd(o,h),g=g.createElement("link"),sn(g);var S=g;S._p=new Promise(function(E,F){S.onload=E,S.onerror=F}),pn(g,"link",o),a.instance=g}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=Yo.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var Qd=0;function Q2(t,r){return t.stylesheets&&t.count===0&&Po(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var o=setTimeout(function(){if(t.stylesheets&&Po(t,t.stylesheets),t.unsuspend){var g=t.unsuspend;t.unsuspend=null,g()}},6e4+r);0<t.imgBytes&&Qd===0&&(Qd=62500*A2());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Po(t,t.stylesheets),t.unsuspend)){var g=t.unsuspend;t.unsuspend=null,g()}},(t.imgBytes>Qd?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(h)}}:null}function Yo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Po(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Xo=null;function Po(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Xo=new Map,r.forEach(Z2,t),Xo=null,Yo.call(t))}function Z2(t,r){if(!(r.state.loading&4)){var a=Xo.get(t);if(a)var o=a.get(null);else{a=new Map,Xo.set(t,a);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var S=h[g];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(a.set(S.dataset.precedence,S),o=S)}o&&a.set(null,o)}h=r.instance,S=h.getAttribute("data-precedence"),g=a.get(S)||o,g===o&&a.set(null,h),a.set(S,h),this.count++,o=Yo.bind(this),h.addEventListener("load",o),h.addEventListener("error",o),g?g.parentNode.insertBefore(h,g.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),r.state.loading|=4}}var ts={$$typeof:C,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function K2(t,r,a,o,h,g,S,E,F){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=qc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qc(0),this.hiddenUpdates=qc(null),this.identifierPrefix=o,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function Xx(t,r,a,o,h,g,S,E,F,ne,de,pe){return t=new K2(t,r,a,S,F,ne,de,pe,E),r=1,g===!0&&(r|=24),g=Un(3,null,null,r),t.current=g,g.stateNode=t,r=Tu(),r.refCount++,t.pooledCache=r,r.refCount++,g.memoizedState={element:o,isDehydrated:a,cache:r},Ru(g),t}function Px(t){return t?(t=Ci,t):Ci}function Qx(t,r,a,o,h,g){h=Px(h),o.context===null?o.context=h:o.pendingContext=h,o=sl(r),o.payload={element:a},g=g===void 0?null:g,g!==null&&(o.callback=g),a=ol(t,o,r),a!==null&&(zn(a,t,r),Ma(a,t,r))}function Zx(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function Zd(t,r){Zx(t,r),(t=t.alternate)&&Zx(t,r)}function Kx(t){if(t.tag===13||t.tag===31){var r=Il(t,67108864);r!==null&&zn(r,t,67108864),Zd(t,67108864)}}function Wx(t){if(t.tag===13||t.tag===31){var r=Vn();r=Vc(r);var a=Il(t,r);a!==null&&zn(a,t,r),Zd(t,r)}}var Qo=!0;function W2(t,r,a,o){var h=B.T;B.T=null;var g=P.p;try{P.p=2,Kd(t,r,a,o)}finally{P.p=g,B.T=h}}function J2(t,r,a,o){var h=B.T;B.T=null;var g=P.p;try{P.p=8,Kd(t,r,a,o)}finally{P.p=g,B.T=h}}function Kd(t,r,a,o){if(Qo){var h=Wd(o);if(h===null)Id(t,r,o,Zo,a),eb(t,o);else if(tw(h,t,r,a,o))o.stopPropagation();else if(eb(t,o),r&4&&-1<ew.indexOf(t)){for(;h!==null;){var g=hi(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var S=Jr(g.pendingLanes);if(S!==0){var E=g;for(E.pendingLanes|=2,E.entangledLanes|=2;S;){var F=1<<31-we(S);E.entanglements[1]|=F,S&=~F}Sr(g),(pt&6)===0&&(Ro=Ot()+500,Qa(0))}}break;case 31:case 13:E=Il(g,2),E!==null&&zn(E,g,2),zo(),Zd(g,2)}if(g=Wd(o),g===null&&Id(t,r,o,Zo,a),g===h)break;h=g}h!==null&&o.stopPropagation()}else Id(t,r,o,null,a)}}function Wd(t){return t=eu(t),Jd(t)}var Zo=null;function Jd(t){if(Zo=null,t=pi(t),t!==null){var r=c(t);if(r===null)t=null;else{var a=r.tag;if(a===13){if(t=d(r),t!==null)return t;t=null}else if(a===31){if(t=f(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return Zo=t,null}function Jx(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(kn()){case ce:return 2;case ve:return 8;case Me:case K:return 32;case Se:return 268435456;default:return 32}default:return 32}}var ef=!1,yl=null,vl=null,Sl=null,ns=new Map,rs=new Map,wl=[],ew="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function eb(t,r){switch(t){case"focusin":case"focusout":yl=null;break;case"dragenter":case"dragleave":vl=null;break;case"mouseover":case"mouseout":Sl=null;break;case"pointerover":case"pointerout":ns.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":rs.delete(r.pointerId)}}function ls(t,r,a,o,h,g){return t===null||t.nativeEvent!==g?(t={blockedOn:r,domEventName:a,eventSystemFlags:o,nativeEvent:g,targetContainers:[h]},r!==null&&(r=hi(r),r!==null&&Kx(r)),t):(t.eventSystemFlags|=o,r=t.targetContainers,h!==null&&r.indexOf(h)===-1&&r.push(h),t)}function tw(t,r,a,o,h){switch(r){case"focusin":return yl=ls(yl,t,r,a,o,h),!0;case"dragenter":return vl=ls(vl,t,r,a,o,h),!0;case"mouseover":return Sl=ls(Sl,t,r,a,o,h),!0;case"pointerover":var g=h.pointerId;return ns.set(g,ls(ns.get(g)||null,t,r,a,o,h)),!0;case"gotpointercapture":return g=h.pointerId,rs.set(g,ls(rs.get(g)||null,t,r,a,o,h)),!0}return!1}function tb(t){var r=pi(t.target);if(r!==null){var a=c(r);if(a!==null){if(r=a.tag,r===13){if(r=d(a),r!==null){t.blockedOn=r,hp(t.priority,function(){Wx(a)});return}}else if(r===31){if(r=f(a),r!==null){t.blockedOn=r,hp(t.priority,function(){Wx(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ko(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=Wd(t.nativeEvent);if(a===null){a=t.nativeEvent;var o=new a.constructor(a.type,a);Jc=o,a.target.dispatchEvent(o),Jc=null}else return r=hi(a),r!==null&&Kx(r),t.blockedOn=a,!1;r.shift()}return!0}function nb(t,r,a){Ko(t)&&a.delete(r)}function nw(){ef=!1,yl!==null&&Ko(yl)&&(yl=null),vl!==null&&Ko(vl)&&(vl=null),Sl!==null&&Ko(Sl)&&(Sl=null),ns.forEach(nb),rs.forEach(nb)}function Wo(t,r){t.blockedOn===r&&(t.blockedOn=null,ef||(ef=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,nw)))}var Jo=null;function rb(t){Jo!==t&&(Jo=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Jo===t&&(Jo=null);for(var r=0;r<t.length;r+=3){var a=t[r],o=t[r+1],h=t[r+2];if(typeof o!="function"){if(Jd(o||a)===null)continue;break}var g=hi(a);g!==null&&(t.splice(r,3),r-=3,Wu(g,{pending:!0,data:h,method:a.method,action:o},o,h))}}))}function Zi(t){function r(F){return Wo(F,t)}yl!==null&&Wo(yl,t),vl!==null&&Wo(vl,t),Sl!==null&&Wo(Sl,t),ns.forEach(r),rs.forEach(r);for(var a=0;a<wl.length;a++){var o=wl[a];o.blockedOn===t&&(o.blockedOn=null)}for(;0<wl.length&&(a=wl[0],a.blockedOn===null);)tb(a),a.blockedOn===null&&wl.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var h=a[o],g=a[o+1],S=h[Tn]||null;if(typeof g=="function")S||rb(a);else if(S){var E=null;if(g&&g.hasAttribute("formAction")){if(h=g,S=g[Tn]||null)E=S.formAction;else if(Jd(h)!==null)continue}else E=S.action;typeof E=="function"?a[o+1]=E:(a.splice(o,3),o-=3),rb(a)}}}function lb(){function t(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(S){return h=S})},focusReset:"manual",scroll:"manual"})}function r(){h!==null&&(h(),h=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),h!==null&&(h(),h=null)}}}function tf(t){this._internalRoot=t}ec.prototype.render=tf.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(i(409));var a=r.current,o=Vn();Qx(a,o,t,r,null,null)},ec.prototype.unmount=tf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;Qx(t.current,2,null,t,null,null),zo(),r[mi]=null}};function ec(t){this._internalRoot=t}ec.prototype.unstable_scheduleHydration=function(t){if(t){var r=pp();t={blockedOn:null,target:t,priority:r};for(var a=0;a<wl.length&&r!==0&&r<wl[a].priority;a++);wl.splice(a,0,t),a===0&&tb(t)}};var ib=n.version;if(ib!=="19.2.4")throw Error(i(527,ib,"19.2.4"));P.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=m(r),t=t!==null?x(t):null,t=t===null?null:t.stateNode,t};var rw={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tc.isDisabled&&tc.supportsFiber)try{Qe=tc.inject(rw),ue=tc}catch{}}return as.createRoot=function(t,r){if(!s(t))throw Error(i(299));var a=!1,o="",h=fg,g=mg,S=pg;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=Xx(t,1,!1,null,null,a,o,null,h,g,S,lb),t[mi]=r.current,Ld(t),new tf(r)},as.hydrateRoot=function(t,r,a){if(!s(t))throw Error(i(299));var o=!1,h="",g=fg,S=mg,E=pg,F=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(S=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError),a.formState!==void 0&&(F=a.formState)),r=Xx(t,1,!0,r,a??null,o,h,F,g,S,E,lb),r.context=Px(null),a=r.current,o=Vn(),o=Vc(o),h=sl(o),h.callback=null,ol(a,h,o),a=o,r.current.lanes=a,ha(r,a),Sr(r),t[mi]=r.current,Ld(t),new ec(r)},as.version="19.2.4",as}var hb;function gw(){if(hb)return lf.exports;hb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),lf.exports=hw(),lf.exports}var xw=gw();const bw=zs(xw);function yw(e,n){if(e instanceof RegExp)return{keys:!1,pattern:e};var l,i,s,c,d=[],f="",p=e.split("/");for(p[0]||p.shift();s=p.shift();)l=s[0],l==="*"?(d.push(l),f+=s[1]==="?"?"(?:/(.*))?":"/(.*)"):l===":"?(i=s.indexOf("?",1),c=s.indexOf(".",1),d.push(s.substring(1,~i?i:~c?c:s.length)),f+=~i&&!~c?"(?:/([^/]+?))?":"/([^/]+?)",~c&&(f+=(~i?"?":"")+"\\"+s.substring(c))):f+="/"+s;return{keys:d,pattern:new RegExp("^"+f+(n?"(?=$|/)":"/?$"),"i")}}var cf={exports:{}},uf={};/**
50
- * @license React
51
- * use-sync-external-store-shim.production.js
52
- *
53
- * Copyright (c) Meta Platforms, Inc. and affiliates.
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE file in the root directory of this source tree.
57
- */var gb;function vw(){if(gb)return uf;gb=1;var e=Nc();function n(b,y){return b===y&&(b!==0||1/b===1/y)||b!==b&&y!==y}var l=typeof Object.is=="function"?Object.is:n,i=e.useState,s=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function f(b,y){var v=y(),w=i({inst:{value:v,getSnapshot:y}}),N=w[0].inst,j=w[1];return c(function(){N.value=v,N.getSnapshot=y,p(N)&&j({inst:N})},[b,v,y]),s(function(){return p(N)&&j({inst:N}),b(function(){p(N)&&j({inst:N})})},[b]),d(v),v}function p(b){var y=b.getSnapshot;b=b.value;try{var v=y();return!l(b,v)}catch{return!0}}function m(b,y){return y()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return uf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,uf}var xb;function Sw(){return xb||(xb=1,cf.exports=vw()),cf.exports}var ww=Sw();const kw=dw.useInsertionEffect,jw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Nw=jw?_.useLayoutEffect:_.useEffect,Cw=kw||Nw,v0=e=>{const n=_.useRef([e,(...l)=>n[0](...l)]).current;return Cw(()=>{n[0]=e}),n[1]},Ew="popstate",dm="pushState",fm="replaceState",Tw="hashchange",bb=[Ew,dm,fm,Tw],Aw=e=>{for(const n of bb)addEventListener(n,e);return()=>{for(const n of bb)removeEventListener(n,e)}},S0=(e,n)=>ww.useSyncExternalStore(Aw,e,n),yb=()=>location.search,Ow=({ssrSearch:e}={})=>S0(yb,e!=null?()=>e:yb),vb=()=>location.pathname,_w=({ssrPath:e}={})=>S0(vb,e!=null?()=>e:vb),Rw=(e,{replace:n=!1,state:l=null}={})=>history[n?fm:dm](l,"",e),Mw=(e={})=>[_w(e),Rw],Sb=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[Sb]>"u"){for(const e of[dm,fm]){const n=history[e];history[e]=function(){const l=n.apply(this,arguments),i=new Event(e);return i.arguments=arguments,dispatchEvent(i),l}}Object.defineProperty(window,Sb,{value:!0})}const zw=(e,n)=>n.toLowerCase().indexOf(e.toLowerCase())?"~"+n:n.slice(e.length)||"/",w0=(e="")=>e==="/"?"":e,Dw=(e,n)=>e[0]==="~"?e.slice(1):w0(n)+e,Lw=(e="",n)=>zw(wb(w0(e)),wb(n)),wb=e=>{try{return decodeURI(e)}catch{return e}},k0={hook:Mw,searchHook:Ow,parser:yw,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,n,l)=>e(n,l)},j0=_.createContext(k0),ca=()=>_.useContext(j0),N0={},C0=_.createContext(N0),Iw=()=>_.useContext(C0),Cc=e=>{const[n,l]=e.hook(e);return[Lw(e.base,n),v0((i,s)=>e.aroundNav(l,Dw(i,e.base),s))]},Zr=()=>Cc(ca()),mm=(e,n,l,i)=>{const{pattern:s,keys:c}=n instanceof RegExp?{keys:!1,pattern:n}:e(n||"*",i),d=s.exec(l)||[],[f,...p]=d;return f!==void 0?[!0,(()=>{const m=c!==!1?Object.fromEntries(c.map((b,y)=>[b,p[y]])):d.groups;let x={...p};return m&&Object.assign(x,m),x})(),...i?[f]:[]]:[!1,null]},E0=e=>mm(ca().parser,e,Zr()[0]),Bw=({children:e,...n})=>{var x,b,y;const l=ca(),i=n.hook?k0:l;let s=i;const[c,d=n.ssrSearch??""]=((x=n.ssrPath)==null?void 0:x.split("?"))??[];c&&(n.ssrSearch=d,n.ssrPath=c),n.hrefs=n.hrefs??((b=n.hook)==null?void 0:b.hrefs),n.searchHook=n.searchHook??((y=n.hook)==null?void 0:y.searchHook);let f=_.useRef({}),p=f.current,m=p;for(let v in i){const w=v==="base"?i[v]+(n[v]??""):n[v]??i[v];p===m&&w!==m[v]&&(f.current=m={...m}),m[v]=w,(w!==i[v]||w!==s[v])&&(s=m)}return _.createElement(j0.Provider,{value:s,children:e})},kb=({children:e,component:n},l)=>n?_.createElement(n,{params:l}):typeof e=="function"?e(l):e,Hw=e=>{let n=_.useRef(N0);const l=n.current;return n.current=Object.keys(e).length!==Object.keys(l).length||Object.entries(e).some(([i,s])=>s!==l[i])?e:l},df=({path:e,nest:n,match:l,...i})=>{const s=ca(),[c]=Cc(s),[d,f,p]=l??mm(s.parser,e,c,n),m=Hw({...Iw(),...f});if(!d)return null;const x=p?_.createElement(Bw,{base:p},kb(i,m)):kb(i,m);return _.createElement(C0.Provider,{value:m,children:x})},Uw=_.forwardRef((e,n)=>{const l=ca(),[i,s]=Cc(l),{to:c="",href:d=c,onClick:f,asChild:p,children:m,className:x,replace:b,state:y,transition:v,...w}=e,N=v0(k=>{k.ctrlKey||k.metaKey||k.altKey||k.shiftKey||k.button!==0||(f==null||f(k),k.defaultPrevented||(k.preventDefault(),s(d,e)))}),j=l.hrefs(d[0]==="~"?d.slice(1):l.base+d,l);return p&&_.isValidElement(m)?_.cloneElement(m,{onClick:N,href:j}):_.createElement("a",{...w,onClick:N,href:j,className:x!=null&&x.call?x(i===d):x,children:m,ref:n})}),T0=e=>Array.isArray(e)?e.flatMap(n=>T0(n&&n.type===_.Fragment?n.props.children:n)):[e],Fw=({children:e,location:n})=>{const l=ca(),[i]=Cc(l);for(const s of T0(e)){let c=0;if(_.isValidElement(s)&&(c=mm(l.parser,s.props.path,n||i,s.props.nest))[0])return _.cloneElement(s,{match:c})}return null},jb=e=>{let n;const l=new Set,i=(m,x)=>{const b=typeof m=="function"?m(n):m;if(!Object.is(b,n)){const y=n;n=x??(typeof b!="object"||b===null)?b:Object.assign({},n,b),l.forEach(v=>v(n,y))}},s=()=>n,f={setState:i,getState:s,getInitialState:()=>p,subscribe:m=>(l.add(m),()=>l.delete(m))},p=n=e(i,s,f);return f},$w=(e=>e?jb(e):jb),Gw=e=>e;function qw(e,n=Gw){const l=ke.useSyncExternalStore(e.subscribe,ke.useCallback(()=>n(e.getState()),[e,n]),ke.useCallback(()=>n(e.getInitialState()),[e,n]));return ke.useDebugValue(l),l}const Nb=e=>{const n=$w(e),l=i=>qw(n,i);return Object.assign(l,n),l},Kr=(e=>e?Nb(e):Nb);function Vw(e){return typeof e=="object"&&e!==null&&"type"in e&&"payload"in e}function uc(){if(typeof crypto<"u"&&crypto.randomUUID)try{return crypto.randomUUID()}catch{}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)})}class Yw{constructor(n){Zl(this,"ws",null);Zl(this,"handlers",new Set);Zl(this,"statusHandler",null);Zl(this,"url");Zl(this,"isReconnecting",!1);Zl(this,"connectingPromise",null);this.url=n}onStatusChange(n){this.statusHandler=n}connect(){var n;return((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN?Promise.resolve():this.connectingPromise?this.connectingPromise:(this.connectingPromise=new Promise((l,i)=>{try{this.ws=new WebSocket(this.url),this.ws.onopen=()=>{var s;this.isReconnecting=!1,this.connectingPromise=null,(s=this.statusHandler)==null||s.call(this,"connected"),l()},this.ws.onclose=()=>{var s;this.connectingPromise=null,(s=this.statusHandler)==null||s.call(this,"disconnected"),this.attemptReconnect()},this.ws.onerror=s=>{console.error("WebSocket error:",s),this.connectingPromise=null,i(s)},this.ws.onmessage=s=>{try{const c=JSON.parse(s.data);console.log("[WS Client] Received message:",c),Vw(c)&&this.handlers.forEach(d=>d(c))}catch(c){console.error("Failed to parse WebSocket message:",c)}}}catch(s){this.connectingPromise=null,i(s)}}),this.connectingPromise)}attemptReconnect(){var n;this.isReconnecting||(this.isReconnecting=!0,(n=this.statusHandler)==null||n.call(this,"reconnecting"),setTimeout(()=>{this.isReconnecting=!1,this.connect().catch(()=>{})},5e3))}disconnect(){this.isReconnecting=!1,this.ws&&(this.ws.close(),this.ws=null)}send(n,l){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Error("WebSocket not connected");const i=uc(),s={id:i,type:n,payload:l};return this.ws.send(JSON.stringify(s)),i}subscribe(n){return this.handlers.add(n),()=>this.handlers.delete(n)}get isConnected(){var n;return((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN}}const Xw=`ws://${window.location.hostname}:${window.location.port||"10369"}/ws`,ot=new Yw(Xw),Pw=3e4;function Qw(e){switch(e){case"vllm":return"vLLM";case"sglang":return"SGLang";case"ollama":return"Ollama";case"llamacpp":return"llama.cpp";case"openai":return"OpenAI";case"anthropic":return"Anthropic";case"auto":return"Auto";case"unknown":return""}}const Nn=Kr((e,n)=>({model:null,maxContext:2e5,llmUrl:null,llmStatus:"unknown",backend:"unknown",providers:[],activeProviderId:null,defaultModelSelection:null,loading:!1,activating:!1,error:null,autoRefreshInterval:null,fetchConfig:async()=>{e({loading:!0,error:null});try{const l=await fetch("/api/config");if(!l.ok)throw new Error("Failed to fetch config");const i=await l.json();e({model:i.model,maxContext:i.maxContext,llmUrl:i.llmUrl,llmStatus:i.llmStatus,backend:i.backend,providers:i.providers??[],activeProviderId:i.activeProviderId??null,defaultModelSelection:i.defaultModelSelection??null,loading:!1})}catch(l){e({error:l instanceof Error?l.message:"Unknown error",loading:!1})}},refreshModel:async()=>{try{const l=await fetch("/api/model/refresh",{method:"POST"});if(!l.ok)throw new Error("Failed to refresh model");const i=await l.json();e({model:i.model,llmStatus:i.llmStatus,backend:i.backend})}catch(l){console.error("Failed to refresh model:",l)}},activateProvider:async l=>{const{activeProviderId:i,providers:s}=n();if(l===i)return!0;e({activating:!0,error:null});try{const c=await fetch(`/api/providers/${l}/activate`,{method:"POST"});if(!c.ok){const f=await c.json();throw new Error(f.error??"Failed to activate provider")}const d=await c.json();return e({activeProviderId:d.activeProviderId,model:d.model,backend:d.backend,providers:s.map(f=>({...f,isActive:f.id===d.activeProviderId})),activating:!1}),!0}catch(c){return e({error:c instanceof Error?c.message:"Failed to switch provider",activating:!1}),!1}},syncFromSession:(l,i)=>{const{providers:s}=n();e({activeProviderId:l,model:i,defaultModelSelection:`${l}/${i}`,providers:s.map(c=>({...c,isActive:c.id===l}))})},startAutoRefresh:()=>{const{autoRefreshInterval:l,refreshModel:i}=n();if(l)return;const s=setInterval(()=>{i()},Pw);e({autoRefreshInterval:s})},stopAutoRefresh:()=>{const{autoRefreshInterval:l}=n();l&&(clearInterval(l),e({autoRefreshInterval:null}))},getActiveProvider:()=>{const{providers:l,activeProviderId:i}=n();return l.find(s=>s.id===i)}})),Nl={GLOBAL_INSTRUCTIONS:"global_instructions",NOTIFICATION_SETTINGS:"notification_settings"},Pr=Kr(e=>({settings:{},loading:{},getSetting:n=>{e(l=>({loading:{...l.loading,[n]:!0}})),ot.send("settings.get",{key:n})},setSetting:(n,l)=>{e(i=>({loading:{...i.loading,[n]:!0}})),ot.send("settings.set",{key:n,value:l})},handleServerMessage:n=>{switch(n.type){case"settings.value":{const l=n.payload;e(i=>({settings:{...i.settings,[l.key]:l.value??""},loading:{...i.loading,[l.key]:!1}}));break}}}})),Cb=[{key:"complete",label:"Task Complete",description:"When an agent finishes its work"},{key:"waiting_for_user",label:"Waiting for Input",description:"When the agent needs your input"},{key:"phase_done",label:"Phase Done",description:"When a build phase completes successfully"},{key:"phase_blocked",label:"Phase Blocked",description:"When a build phase is blocked and needs intervention"}],Zw=[{key:"planner",label:"Planner"},{key:"build",label:"Builder"},{key:"sub-agent",label:"Sub-agent"}],Kw=[{url:"/sounds/notification.mp3",label:"Notification"},{url:"/sounds/waiting-for-user.mp3",label:"Waiting for User"},{url:"/sounds/achievement.mp3",label:"Achievement"},{url:"/sounds/intervention.mp3",label:"Intervention"}],pm={complete:"/sounds/notification.mp3",waiting_for_user:"/sounds/waiting-for-user.mp3",phase_done:"/sounds/achievement.mp3",phase_blocked:"/sounds/intervention.mp3"},Cl={soundEnabled:!0,browserNotification:!1,customSoundUrl:null},$f={soundEnabled:!0,browserNotificationEnabled:!1,events:{complete:{...Cl},waiting_for_user:{...Cl},phase_done:{...Cl},phase_blocked:{...Cl}},agentOverrides:{}};function A0(e,n,l){var c;const i=e.events[n];if(!l)return i;const s=(c=e.agentOverrides[l])==null?void 0:c[n];return s?{soundEnabled:s.soundEnabled??i.soundEnabled,browserNotification:s.browserNotification??i.browserNotification,customSoundUrl:s.customSoundUrl!==void 0?s.customSoundUrl:i.customSoundUrl}:i}const ti=Kr((e,n)=>({settings:$f,loaded:!1,load:()=>{Pr.getState().getSetting(Nl.NOTIFICATION_SETTINGS);const i=Pr.subscribe(c=>{const d=c.settings[Nl.NOTIFICATION_SETTINGS];if(d!==void 0)try{const f=JSON.parse(d);e({settings:Eb(f),loaded:!0})}catch{e({loaded:!0})}}),s=Pr.getState().settings[Nl.NOTIFICATION_SETTINGS];if(s)try{const c=JSON.parse(s);e({settings:Eb(c),loaded:!0})}catch{e({loaded:!0})}return i},update:l=>{e({settings:l}),ff(l)},updateEvent:(l,i)=>{const s=n().settings,c={...s,events:{...s.events,[l]:{...s.events[l],...i}}};e({settings:c}),ff(c)},updateAgentOverride:(l,i,s)=>{var p;const c=n().settings,d={...c.agentOverrides};if(s===null){if(d[l]){const m={...d[l]};delete m[i],Object.keys(m).length===0?delete d[l]:d[l]=m}}else d[l]={...d[l],[i]:{...((p=d[l])==null?void 0:p[i])??{},...s}};const f={...c,agentOverrides:d};e({settings:f}),ff(f)}}));function ff(e){Pr.getState().setSetting(Nl.NOTIFICATION_SETTINGS,JSON.stringify(e))}function Eb(e){var n,l,i,s;return{soundEnabled:e.soundEnabled??$f.soundEnabled,browserNotificationEnabled:e.browserNotificationEnabled??$f.browserNotificationEnabled,events:{complete:{...Cl,...(n=e.events)==null?void 0:n.complete},waiting_for_user:{...Cl,...(l=e.events)==null?void 0:l.waiting_for_user},phase_done:{...Cl,...(i=e.events)==null?void 0:i.phase_done},phase_blocked:{...Cl,...(s=e.events)==null?void 0:s.phase_blocked}},agentOverrides:e.agentOverrides??{}}}const Tb=new Map;function Ww(e){let n=Tb.get(e);return n||(n=new Audio(e),n.volume=.5,Tb.set(e,n)),n}let O0=typeof Notification<"u"?Notification.permission:"denied";function Jw(){return typeof Notification>"u"?Promise.resolve("denied"):Notification.requestPermission().then(e=>(O0=e,e))}const ek={complete:"Task Complete",waiting_for_user:"Waiting for Input",phase_done:"Phase Complete",phase_blocked:"Phase Blocked"},tk={complete:"The agent has finished its work.",waiting_for_user:"The agent needs your input to continue.",phase_done:"The build phase completed successfully.",phase_blocked:"The build phase is blocked and needs intervention."};function nk(e){typeof Notification>"u"||O0==="granted"&&(document.hasFocus()||new Notification(ek[e],{body:tk[e],icon:"/fox.svg",tag:`openfox-${e}`}))}function Ec(e,n){const{settings:l}=ti.getState(),i=A0(l,e,n);if(l.soundEnabled&&i.soundEnabled){const s=i.customSoundUrl??pm[e],c=Ww(s);c.currentTime=0,c.play().catch(()=>{})}l.browserNotificationEnabled&&i.browserNotification&&nk(e)}const rk=e=>Ec("complete",e),lk=e=>Ec("phase_done",e),ik=e=>Ec("phase_blocked",e),ak=e=>Ec("waiting_for_user",e);let Ab=!1;const Zt={messageId:null,deltaContent:"",thinkingContent:"",toolOutput:[]};let la=null,xn=null;function mf(){la===null&&(la=requestAnimationFrame(()=>{la=null,xn==null||xn()}))}function Kl(){la!==null&&(cancelAnimationFrame(la),la=null)}function nn(e,n){return n!==null&&e.sessionId===n}function sk(e,n){return e.id!==void 0||nn(e,n)}function ok(e,n){return e.includes(n)?e:[...e,n]}function ss(e,n){return e.filter(l=>l!==n)}function ck(e,n){const l=e.find(s=>s.id===n.id),i=l?{...l,projectId:n.projectId,workdir:n.workdir,mode:n.mode,phase:n.phase,isRunning:n.isRunning}:{id:n.id,projectId:n.projectId,workdir:n.workdir,mode:n.mode,phase:n.phase,isRunning:n.isRunning,createdAt:"",updatedAt:"",criteriaCount:n.criteria.length,criteriaCompleted:n.criteria.filter(s=>s.status.type==="passed").length};return l?e.map(s=>s.id===n.id?i:s):[i,...e]}function uk(e,n,l){return e.map(i=>{const s=(l==null?void 0:l.id)===i.id?l:null,c=n.find(d=>d.id===i.id);return{...i,title:i.title??(c==null?void 0:c.title),mode:(s==null?void 0:s.mode)??(c==null?void 0:c.mode)??i.mode,phase:(s==null?void 0:s.phase)??(c==null?void 0:c.phase)??i.phase,isRunning:(s==null?void 0:s.isRunning)??(c==null?void 0:c.isRunning)??i.isRunning,recentUserPrompts:i.recentUserPrompts}})}const Ob=new Map;function pf(e,n){var c;const l=n===((c=e.currentSession)==null?void 0:c.id)?e.currentSession:null,i=e.sessions.find(d=>d.id===n),s=(l==null?void 0:l.mode)??(i==null?void 0:i.mode);return s==="planner"?"planner":s==="builder"?"build":"planner"}function dk(e,n){if(e.type==="chat.done"){const l=e.payload,i=pf(n,e.sessionId);l.reason==="complete"&&rk(i),l.reason==="waiting_for_user"&&ak(i);return}if(e.type==="task.completed"){const l=pf(n,e.sessionId);lk(l);return}if(e.type==="phase.changed"&&e.sessionId){const l=e.payload,i=Ob.get(e.sessionId)??null;if(Ob.set(e.sessionId,l.phase),i===l.phase)return;const s=pf(n,e.sessionId);l.phase==="blocked"&&ik(s)}}const Ae=Kr((e,n)=>(xn=()=>{const l=Zt;if(!l.messageId)return;const i=l.deltaContent.length>0,s=l.thinkingContent.length>0,c=l.toolOutput.length>0;if(!i&&!s&&!c)return;const d=l.deltaContent,f=l.thinkingContent,p=l.toolOutput;l.deltaContent="",l.thinkingContent="",l.toolOutput=[],e(m=>{var b;const x=m.streamingMessage;if(x&&x.id===l.messageId){let y={...x};if(i&&(y.content=y.content+d),s&&(y.thinkingContent=(y.thinkingContent??"")+f),c){const v=new Set;y.toolCalls=(b=y.toolCalls)==null?void 0:b.map(N=>{const j=p.filter(k=>k.callId===N.id);return j.length===0?N:(v.add(N.id),{...N,streamingOutput:[...N.streamingOutput??[],...j.map(k=>({stream:k.stream,content:k.content}))]})});const w=p.filter(N=>!v.has(N.callId));w.length>0&&Zt.toolOutput.push(...w)}return{streamingMessage:y}}if(c){const y=new Set,v=m.messages.map(N=>{var k;if(N.id!==l.messageId)return N;const j=(k=N.toolCalls)==null?void 0:k.map(T=>{const C=p.filter(L=>L.callId===T.id);return C.length===0?T:(y.add(T.id),{...T,streamingOutput:[...T.streamingOutput??[],...C.map(L=>({stream:L.stream,content:L.content}))]})});return{...N,toolCalls:j}}),w=p.filter(N=>!y.has(N.callId));return w.length>0&&Zt.toolOutput.push(...w),{messages:v}}return m})},{connectionStatus:"disconnected",sessions:[],currentSession:null,unreadSessionIds:[],messages:[],streamingMessageId:null,streamingMessage:null,currentTodos:[],contextState:null,pendingPathConfirmation:null,queuedMessages:[],abortInProgress:!1,error:null,pendingSessionCreate:!1,connect:async()=>{const l=n().connectionStatus;if(!(l==="connected"||l==="reconnecting")){e({connectionStatus:"reconnecting"}),ot.onStatusChange(i=>{e({connectionStatus:i}),i==="connected"&&n().listSessions()});try{await ot.connect(),Ab||(Ab=!0,ot.subscribe(n().handleServerMessage))}catch(i){console.error("Failed to connect:",i),e({connectionStatus:"disconnected"})}}},disconnect:()=>{ot.disconnect(),e({connectionStatus:"disconnected"})},createSession:(l,i)=>{e({pendingSessionCreate:!0}),ot.send("session.create",{projectId:l,title:i})},loadSession:l=>{const i=n().currentSession;!i||i.id!==l?(Kl(),e({currentSession:null,unreadSessionIds:ss(n().unreadSessionIds,l),messages:[],streamingMessageId:null,streamingMessage:null,currentTodos:[],contextState:null,pendingPathConfirmation:null,queuedMessages:[],abortInProgress:!1,error:null})):e({unreadSessionIds:ss(n().unreadSessionIds,l)}),ot.send("session.load",{sessionId:l})},listSessions:()=>{ot.send("session.list",{})},deleteSession:l=>{ot.send("session.delete",{sessionId:l})},deleteAllSessions:l=>{ot.send("session.deleteAll",{projectId:l})},clearSession:()=>{Kl(),e(l=>({currentSession:null,messages:[],streamingMessageId:null,streamingMessage:null,currentTodos:[],contextState:null,unreadSessionIds:l.currentSession?ss(l.unreadSessionIds,l.currentSession.id):l.unreadSessionIds}))},sendMessage:(l,i,s)=>{e({streamingMessageId:null}),ot.send("chat.send",{content:l,attachments:i,...s})},stopGeneration:()=>{n().abortInProgress||(Kl(),xn==null||xn(),ot.send("chat.stop",{}),e({abortInProgress:!0}))},continueGeneration:()=>{e({streamingMessageId:null}),ot.send("chat.continue",{})},launchRunner:(l,i,s)=>{e({streamingMessageId:null});const c={};l!=null&&l.trim()&&(c.content=l,i&&i.length>0&&(c.attachments=i)),s&&(c.workflowId=s),ot.send("runner.launch",c)},switchMode:l=>{ot.send("mode.switch",{mode:l})},acceptAndBuild:l=>{e({streamingMessageId:null}),ot.send("mode.accept",l?{workflowId:l}:{})},editCriteria:l=>{ot.send("criteria.edit",{criteria:l})},compactContext:()=>{ot.send("context.compact",{})},setSessionProvider:(l,i)=>{ot.send("session.setProvider",{providerId:l,...i?{model:i}:{}})},confirmPath:(l,i)=>{ot.send("path.confirm",{callId:l,approved:i}),e({pendingPathConfirmation:null})},queueAsap:(l,i)=>{ot.send("queue.asap",{content:l,attachments:i})},queueCompletion:(l,i)=>{ot.send("queue.completion",{content:l,attachments:i})},cancelQueued:l=>{ot.send("queue.cancel",{queueId:l})},clearError:()=>{e({error:null})},resetPendingSessionCreate:()=>{e({pendingSessionCreate:!1})},handleServerMessage:l=>{var d,f,p,m,x,b,y,v,w,N,j,k,T,C,L,G,I,R,X,U,D,Q;const i=n();dk(l,i);const s=((d=i.currentSession)==null?void 0:d.id)??null,c=()=>{const M=l.sessionId;!M||M===s||e(V=>({unreadSessionIds:ok(V.unreadSessionIds,M)}))};switch(l.type){case"session.state":{const M=l.payload;if(!sk(l,s))break;Kl();const V=M.messages.find(H=>H.isStreaming)??null;if(e({currentSession:M.session,sessions:ck(n().sessions,M.session),unreadSessionIds:ss(n().unreadSessionIds,M.session.id),messages:M.messages,streamingMessageId:(V==null?void 0:V.id)??null,streamingMessage:V,currentTodos:[],pendingPathConfirmation:null,error:null}),M.session.providerId&&M.session.providerModel){const H=Nn.getState();H.providers.find(B=>B.id===M.session.providerId)&&H.syncFromSession(M.session.providerId,M.session.providerModel)}break}case"session.list":{const M=l.payload;e(V=>({sessions:uk(M.sessions,V.sessions,V.currentSession)}));break}case"session.deleted":{const M=l.payload;e(V=>({unreadSessionIds:ss(V.unreadSessionIds,M.sessionId)})),n().listSessions();break}case"session.deletedAll":{n().listSessions();break}case"session.running":{const M=l.payload,V=l.sessionId,H=(f=n().currentSession)==null?void 0:f.id,q=V&&V!==H;e(B=>({sessions:B.sessions.map(P=>P.id===V?{...P,isRunning:M.isRunning}:P)})),q||e(B=>({currentSession:B.currentSession?{...B.currentSession,isRunning:M.isRunning}:null,pendingPathConfirmation:M.isRunning?B.pendingPathConfirmation:null,...M.isRunning?{}:{abortInProgress:!1,queuedMessages:[]}}));break}case"chat.message":{if(!nn(l,((p=n().currentSession)==null?void 0:p.id)??null)){c();break}const M=l.payload;e(V=>V.messages.some(H=>H.id===M.message.id)?V:{messages:[...V.messages,M.message],streamingMessageId:M.message.isStreaming?M.message.id:V.streamingMessageId,streamingMessage:M.message.isStreaming?M.message:V.streamingMessage});break}case"chat.message_updated":{if(!nn(l,((m=n().currentSession)==null?void 0:m.id)??null)){c();break}const M=l.payload,V=M.updates.isStreaming===!1&&n().streamingMessageId===M.messageId;V&&(Kl(),xn==null||xn()),e(H=>{const q=H.streamingMessage,B=V;if(q&&q.id===M.messageId){const P={...q,...M.updates};return{messages:H.messages.map(oe=>oe.id===M.messageId?P:oe),streamingMessageId:B?null:H.streamingMessageId,streamingMessage:B?null:{...q,...M.updates}}}return{messages:H.messages.map(P=>P.id===M.messageId?{...P,...M.updates}:P),streamingMessageId:B?null:H.streamingMessageId}});break}case"chat.delta":{if(!nn(l,((x=n().currentSession)==null?void 0:x.id)??null)){c();break}const M=l.payload;Zt.messageId=M.messageId,Zt.deltaContent+=M.content,mf();break}case"chat.thinking":{if(!nn(l,((b=n().currentSession)==null?void 0:b.id)??null)){c();break}const M=l.payload;Zt.messageId=M.messageId,Zt.thinkingContent+=M.content,mf();break}case"chat.tool_preparing":{if(!nn(l,((y=n().currentSession)==null?void 0:y.id)??null)){c();break}const M=l.payload;e(V=>{const H=V.streamingMessage;return H&&H.id===M.messageId?{streamingMessage:{...H,preparingToolCalls:[...H.preparingToolCalls??[],{index:M.index,name:M.name}]}}:{messages:V.messages.map(q=>q.id===M.messageId?{...q,preparingToolCalls:[...q.preparingToolCalls??[],{index:M.index,name:M.name}]}:q)}});break}case"chat.tool_call":{if(!nn(l,((v=n().currentSession)==null?void 0:v.id)??null)){c();break}const M=l.payload,V=H=>{var P;const q=(P=H.preparingToolCalls)==null?void 0:P.filter((oe,ae)=>{var A;return oe.name===M.tool?(A=H.preparingToolCalls)==null?void 0:A.slice(0,ae).some(W=>W.name===M.tool):!0}),B=Zt.toolOutput.filter(oe=>oe.callId===M.callId);return B.length>0&&(Zt.toolOutput=Zt.toolOutput.filter(oe=>oe.callId!==M.callId)),{...H,toolCalls:[...H.toolCalls??[],{id:M.callId,name:M.tool,arguments:M.args,startedAt:Date.now(),...B.length>0?{streamingOutput:B.map(oe=>({stream:oe.stream,content:oe.content}))}:{}}],...q&&q.length>0?{preparingToolCalls:q}:{preparingToolCalls:void 0}}};e(H=>{const q=H.streamingMessage;return q&&q.id===M.messageId?{streamingMessage:V(q)}:{messages:H.messages.map(B=>B.id===M.messageId?V(B):B)}});break}case"chat.tool_output":{if(!nn(l,((w=n().currentSession)==null?void 0:w.id)??null)){c();break}const M=l.payload;Zt.messageId=M.messageId,Zt.toolOutput.push({messageId:M.messageId,callId:M.callId,stream:M.stream,content:M.output}),mf();break}case"chat.tool_result":{if(!nn(l,((N=n().currentSession)==null?void 0:N.id)??null)){c();break}const M=l.payload,V=H=>{var B;const q=(B=H.toolCalls)==null?void 0:B.map(P=>P.id===M.callId?{...P,result:M.result}:P);return{...H,toolCalls:q}};e(H=>{const q=H.streamingMessage;return q&&q.id===M.messageId?{streamingMessage:V(q)}:{messages:H.messages.map(B=>B.id===M.messageId?V(B):B)}});break}case"chat.todo":{if(!nn(l,((j=n().currentSession)==null?void 0:j.id)??null)){c();break}const M=l.payload;e({currentTodos:M.todos});break}case"chat.summary":{if(!nn(l,((k=n().currentSession)==null?void 0:k.id)??null)){c();break}const M=l.payload;e(V=>({currentSession:V.currentSession?{...V.currentSession,summary:M.summary}:null}));break}case"chat.progress":{if(!nn(l,((T=n().currentSession)==null?void 0:T.id)??null)){c();break}const M=l.payload;console.log("Progress:",M.message,M.phase);break}case"chat.format_retry":{if(!nn(l,((C=n().currentSession)==null?void 0:C.id)??null)){c();break}const M=l.payload;console.log("Format retry:",M.attempt,"/",M.maxAttempts);break}case"chat.done":{if(!nn(l,((L=n().currentSession)==null?void 0:L.id)??null)){c();break}Kl(),xn==null||xn();const M=l.payload,V=M.stats;Zt.messageId=null,Zt.deltaContent="",Zt.thinkingContent="",Zt.toolOutput=[],e(H=>{const q=H.streamingMessage,B=q&&q.id===M.messageId?{...q,isStreaming:!1,stats:V??q.stats}:null;return{messages:H.messages.map(P=>P.id===M.messageId?B??{...P,isStreaming:!1,stats:V??P.stats}:P),streamingMessageId:null,streamingMessage:null}});break}case"chat.error":{if(!nn(l,((G=n().currentSession)==null?void 0:G.id)??null)){c();break}Kl(),xn==null||xn();const M=l.payload;console.error("Chat error:",M.error,"recoverable:",M.recoverable),M.recoverable||(Zt.messageId=null,Zt.deltaContent="",Zt.thinkingContent="",Zt.toolOutput=[]),e(V=>({error:{code:"CHAT_ERROR",message:M.error},streamingMessageId:M.recoverable?V.streamingMessageId:null,...M.recoverable?{}:{messages:V.streamingMessage?V.messages.map(H=>H.id===V.streamingMessage.id?V.streamingMessage:H):V.messages,streamingMessage:null}}));break}case"chat.path_confirmation":{if(!nn(l,((I=n().currentSession)==null?void 0:I.id)??null)){c();break}const M=l.payload;e({pendingPathConfirmation:{callId:M.callId,tool:M.tool,paths:M.paths,workdir:M.workdir,reason:M.reason}});break}case"mode.changed":{if(!nn(l,((R=n().currentSession)==null?void 0:R.id)??null)){c();break}const M=l.payload;e(V=>({currentSession:V.currentSession?{...V.currentSession,mode:M.mode}:null}));break}case"phase.changed":{const M=l.payload,V=l.sessionId,H=(X=n().currentSession)==null?void 0:X.id,q=V&&V!==H;e(B=>({sessions:B.sessions.map(P=>P.id===V?{...P,phase:M.phase}:P)})),q||e(B=>({currentSession:B.currentSession?{...B.currentSession,phase:M.phase}:null}));break}case"criteria.updated":{if(!nn(l,((U=n().currentSession)==null?void 0:U.id)??null)){c();break}const M=l.payload;e(V=>({currentSession:V.currentSession?{...V.currentSession,criteria:M.criteria}:null}));break}case"context.state":{if(!nn(l,((D=n().currentSession)==null?void 0:D.id)??null)){c();break}const M=l.payload;e({contextState:M.context});break}case"session.name_generated":{const M=l.payload,V=l.sessionId,H=(Q=n().currentSession)==null?void 0:Q.id;e(q=>{const B=q.sessions.map(oe=>oe.id===V?{...oe,title:M.name,updatedAt:new Date().toISOString()}:oe),P=H===V?q.currentSession?{...q.currentSession,title:M.name,updatedAt:new Date().toISOString()}:null:q.currentSession;return{sessions:B,currentSession:P}});break}case"queue.state":{const M=l.payload;e({queuedMessages:M.messages});break}case"error":{const M=l.payload;console.error("Server error:",M),e({error:{code:M.code,message:M.message},streamingMessageId:null});break}}}}));function fk(){return Ae(e=>{var n;return((n=e.currentSession)==null?void 0:n.isRunning)??!1})}function mk(){return Ae(e=>e.queuedMessages)}function pk(){return Ae(e=>e.abortInProgress)}const Jt=Kr((e,n)=>({projects:[],currentProject:null,listProjects:()=>{ot.send("project.list",{})},createProject:(l,i)=>{ot.send("project.create",{name:l,workdir:i})},loadProject:l=>{ot.send("project.load",{projectId:l})},updateProject:(l,i)=>{ot.send("project.update",{projectId:l,...i})},deleteProject:l=>{ot.send("project.delete",{projectId:l})},clearProject:()=>{e({currentProject:null})},handleServerMessage:l=>{switch(l.type){case"project.state":{const i=l.payload;e({currentProject:i.project});break}case"project.list":{const i=l.payload;e({projects:i.projects});break}case"project.deleted":{n().listProjects();const i=n().currentProject,s=l.payload.projectId;(i==null?void 0:i.id)===s&&e({currentProject:null});break}}}}));function hk(){const e=Ae(c=>c.connect),n=Ae(c=>c.connectionStatus),l=Jt(c=>c.handleServerMessage),i=Pr(c=>c.handleServerMessage),s=ti(c=>c.load);return _.useEffect(()=>{e()},[e]),_.useEffect(()=>{if(n==="connected")return ot.subscribe(l)},[n,l]),_.useEffect(()=>{if(n==="connected")return ot.subscribe(i)},[n,i]),_.useEffect(()=>{n==="connected"&&s()},[n,s]),{connectionStatus:n}}var _0=y0();const gk=zs(_0);function In({isOpen:e,onClose:n,title:l,children:i,size:s="md"}){const c=_.useRef(null),d=_.useRef(null),f=_.useCallback(m=>{m.key==="Escape"&&n()},[n]);if(_.useEffect(()=>{var m,x;return e?(d.current=document.activeElement,(m=c.current)==null||m.focus(),document.body.style.overflow="hidden"):((x=d.current)==null||x.focus(),document.body.style.overflow=""),()=>{document.body.style.overflow=""}},[e]),_.useEffect(()=>{if(e)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,f]),!e)return null;const p={sm:"max-w-sm md:max-w-sm",md:"max-w-[90vw] md:max-w-md",lg:"max-w-[90vw] md:max-w-2xl",xl:"max-w-[90vw] md:max-w-4xl",full:"max-w-[95vw]"};return _0.createPortal(u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[u.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:n}),u.jsxs("div",{ref:c,tabIndex:-1,className:`relative w-full ${p[s]} bg-bg-secondary border border-border rounded shadow-xl flex flex-col max-h-[90vh]`,children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border flex-shrink-0",children:[u.jsx("h2",{className:"text-lg font-semibold text-text-primary truncate",children:l}),u.jsx("button",{onClick:n,className:"p-1 rounded hover:bg-bg-tertiary text-text-muted hover:text-text-primary transition-colors flex-shrink-0",children:u.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),u.jsx("div",{className:"p-4 overflow-y-auto flex-1 min-h-0",children:i})]})]}),document.body)}const gt=_.forwardRef(({variant:e="secondary",size:n="md",className:l="",children:i,...s},c)=>{const d="rounded font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed",f={primary:"bg-accent-primary/25 text-white hover:bg-accent-primary/40",secondary:"bg-bg-tertiary text-text-primary hover:bg-border",danger:"bg-accent-error text-white hover:bg-accent-error/80"},p={sm:"px-1.5 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"};return u.jsx("button",{ref:c,className:`${d} ${f[e]} ${p[n]} ${l}`,...s,children:i})});gt.displayName="Button";function xk(e){const n=new Audio(e);n.volume=.5,n.play().catch(()=>{})}function R0({value:e,defaultUrl:n,disabled:l,onChange:i}){const s=e??n;return u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("select",{value:s,disabled:l,onChange:c=>{const d=c.target.value;i(d===n?null:d)},className:"px-2 py-1 text-xs bg-bg-tertiary border border-border rounded focus:outline-none focus:ring-1 focus:ring-accent-primary disabled:opacity-40",children:Kw.map(({url:c,label:d})=>u.jsxs("option",{value:c,children:[d,c===n?" (default)":""]},c))}),u.jsx("button",{onClick:()=>xk(s),disabled:l,className:"p-1 rounded hover:bg-bg-tertiary text-text-muted hover:text-text-primary disabled:opacity-40 disabled:cursor-not-allowed transition-colors",title:"Preview sound",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.536 8.464a5 5 0 010 7.072M17.95 6.05a8 8 0 010 11.9M6.5 8.8h-2a1 1 0 00-1 1v4.4a1 1 0 001 1h2l4.5 3.5V5.3L6.5 8.8z"})})})]})}function bk(){const e=ti(p=>p.settings),n=ti(p=>p.update),l=ti(p=>p.updateEvent),i=ti(p=>p.updateAgentOverride),s=ti(p=>p.load),[c,d]=_.useState(null);_.useEffect(()=>{s()},[s]);const f=async()=>{await Jw()==="granted"&&n({...e,browserNotificationEnabled:!0})};return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"space-y-3",children:[u.jsx("h3",{className:"text-sm font-medium text-text-primary",children:"Master Controls"}),u.jsx(_b,{label:"Sound notifications",description:"Play sounds when events occur",checked:e.soundEnabled,onChange:p=>n({...e,soundEnabled:p})}),u.jsx(_b,{label:"Browser notifications",description:"Show desktop notifications when the window is not focused",checked:e.browserNotificationEnabled,onChange:p=>{p&&typeof Notification<"u"&&Notification.permission!=="granted"?f():n({...e,browserNotificationEnabled:p})}}),typeof Notification<"u"&&Notification.permission==="denied"&&e.browserNotificationEnabled&&u.jsx("p",{className:"text-xs text-accent-error ml-6",children:"Browser notifications are blocked. Please enable them in your browser settings."})]}),u.jsxs("div",{className:"space-y-3",children:[u.jsx("h3",{className:"text-sm font-medium text-text-primary",children:"Event Configuration"}),Cb.map(({key:p,label:m,description:x})=>u.jsx(yk,{event:p,label:m,description:x,config:e.events[p],onUpdate:b=>l(p,b),soundMasterEnabled:e.soundEnabled,browserMasterEnabled:e.browserNotificationEnabled},p))]}),u.jsxs("div",{className:"space-y-3",children:[u.jsx("h3",{className:"text-sm font-medium text-text-primary",children:"Per-Agent Overrides"}),u.jsx("p",{className:"text-xs text-text-muted",children:"Override notification settings for specific agent types. Unconfigured events use the global defaults above."}),Zw.map(({key:p,label:m})=>u.jsxs("div",{className:"border border-border rounded",children:[u.jsxs("button",{className:"w-full flex items-center justify-between px-3 py-2 text-sm text-text-secondary hover:bg-bg-tertiary transition-colors rounded",onClick:()=>d(c===p?null:p),children:[u.jsx("span",{className:"font-medium",children:m}),u.jsx("svg",{className:`w-4 h-4 transition-transform ${c===p?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),c===p&&u.jsx("div",{className:"px-3 pb-3 space-y-3 border-t border-border pt-2",children:Cb.map(({key:x,label:b})=>{var j;const y=(j=e.agentOverrides[p])==null?void 0:j[x],v=y!==void 0,w=A0(e,x,p),N=pm[x];return u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsx("input",{type:"checkbox",checked:v,onChange:k=>{k.target.checked?i(p,x,{soundEnabled:w.soundEnabled,browserNotification:w.browserNotification}):i(p,x,null)},className:"rounded border-border"}),u.jsx("span",{className:`flex-1 ${v?"text-text-primary":"text-text-muted"}`,children:b}),v&&u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"flex items-center gap-1 text-text-secondary",children:[u.jsx("input",{type:"checkbox",checked:w.soundEnabled,onChange:k=>i(p,x,{soundEnabled:k.target.checked}),className:"rounded border-border"}),"Sound"]}),u.jsxs("label",{className:"flex items-center gap-1 text-text-secondary",children:[u.jsx("input",{type:"checkbox",checked:w.browserNotification,onChange:k=>i(p,x,{browserNotification:k.target.checked}),className:"rounded border-border"}),"Browser"]})]})]}),v&&w.soundEnabled&&u.jsx("div",{className:"ml-6",children:u.jsx(R0,{value:(y==null?void 0:y.customSoundUrl)??null,defaultUrl:N,onChange:k=>i(p,x,{customSoundUrl:k})})})]},x)})})]},p))]})]})}function _b({label:e,description:n,checked:l,onChange:i}){return u.jsxs("label",{className:"flex items-start gap-3 cursor-pointer group",children:[u.jsx("div",{className:"pt-0.5",children:u.jsx("div",{className:`relative w-9 h-5 rounded-full transition-colors ${l?"bg-accent-primary":"bg-bg-tertiary border border-border"}`,onClick:s=>{s.preventDefault(),i(!l)},children:u.jsx("div",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform ${l?"translate-x-4":"translate-x-0.5"}`})})}),u.jsxs("div",{children:[u.jsx("div",{className:"text-sm text-text-primary group-hover:text-accent-primary transition-colors",children:e}),u.jsx("div",{className:"text-xs text-text-muted",children:n})]})]})}function yk({event:e,label:n,description:l,config:i,onUpdate:s,soundMasterEnabled:c,browserMasterEnabled:d}){return u.jsxs("div",{className:"border border-border rounded px-3 py-2 space-y-2",children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-sm text-text-primary",children:n}),u.jsx("div",{className:"text-xs text-text-muted",children:l})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-text-secondary",children:[u.jsx("input",{type:"checkbox",checked:i.soundEnabled,onChange:f=>s({soundEnabled:f.target.checked}),disabled:!c,className:"rounded border-border"}),"Sound ",!c&&u.jsx("span",{className:"text-text-muted",children:"(master off)"})]}),u.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-text-secondary",children:[u.jsx("input",{type:"checkbox",checked:i.browserNotification,onChange:f=>s({browserNotification:f.target.checked}),disabled:!d,className:"rounded border-border"}),"Browser notification ",!d&&u.jsx("span",{className:"text-text-muted",children:"(master off)"})]})]}),i.soundEnabled&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-xs text-text-muted",children:"Sound:"}),u.jsx(R0,{value:i.customSoundUrl,defaultUrl:pm[e],disabled:!c,onChange:f=>s({customSoundUrl:f})})]})]})}function vk({isOpen:e,onClose:n}){const[l,i]=_.useState("instructions");return u.jsx(In,{isOpen:e,onClose:n,title:"Global Settings",size:"lg",children:u.jsxs("div",{className:"flex flex-col h-full",children:[u.jsxs("div",{className:"flex border-b border-border mb-4 -mt-1",children:[u.jsx(Rb,{label:"Instructions",active:l==="instructions",onClick:()=>i("instructions")}),u.jsx(Rb,{label:"Notifications",active:l==="notifications",onClick:()=>i("notifications")})]}),l==="instructions"&&u.jsx(Sk,{isOpen:e,onClose:n}),l==="notifications"&&u.jsx(bk,{})]})})}function Rb({label:e,active:n,onClick:l}){return u.jsx("button",{onClick:l,className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${n?"border-accent-primary text-accent-primary":"border-transparent text-text-muted hover:text-text-secondary hover:border-border"}`,children:e})}function Sk({isOpen:e,onClose:n}){const l=Pr(j=>j.settings),i=Pr(j=>j.loading),s=Pr(j=>j.getSetting),c=Pr(j=>j.setSetting),d=l[Nl.GLOBAL_INSTRUCTIONS]??"",f=i[Nl.GLOBAL_INSTRUCTIONS]??!1,[p,m]=_.useState(d),[x,b]=_.useState(!1),[y,v]=_.useState(!1);_.useEffect(()=>{e&&s(Nl.GLOBAL_INSTRUCTIONS)},[e,s]),_.useEffect(()=>{m(d),b(!1)},[d]);const w=async()=>{v(!0),c(Nl.GLOBAL_INSTRUCTIONS,p),v(!1),b(!1),n()},N=f||y;return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-text-primary mb-2",children:"Global Instructions"}),u.jsx("p",{className:"text-sm text-text-muted mb-2",children:"These instructions are injected into every prompt, regardless of project."}),u.jsx("textarea",{value:p,onChange:j=>{m(j.target.value),b(!0)},placeholder:"Enter global instructions that apply to all projects...",className:"w-full h-64 px-3 py-2 bg-bg-tertiary border border-border rounded text-sm font-mono resize-none focus:outline-none focus:ring-1 focus:ring-accent-primary",disabled:N})]}),u.jsxs("div",{className:"flex justify-end gap-2 pt-2 border-t border-border",children:[u.jsx(gt,{variant:"secondary",onClick:n,children:"Cancel"}),u.jsx(gt,{variant:"primary",onClick:w,disabled:!x||N,children:y?"Saving...":"Save"})]})]})}const pr=Kr((e,n)=>({skills:[],defaultIds:[],modifiedIds:[],loading:!1,fetchDefaultIds:async()=>{try{const i=await(await fetch("/api/skills/default-ids")).json();e({defaultIds:i.ids??[]})}catch{}},fetchSkills:async()=>{e({loading:!0});try{const i=await(await fetch("/api/skills")).json();e({skills:i.skills??[],defaultIds:i.defaultIds??n().defaultIds,modifiedIds:i.modifiedIds??[],loading:!1})}catch{e({loading:!1})}},toggleSkill:async l=>{try{const s=await(await fetch(`/api/skills/${l}/toggle`,{method:"POST"})).json();e({skills:n().skills.map(c=>c.id===l?{...c,enabled:s.enabled}:c)})}catch{}},fetchSkill:async l=>{try{const i=await fetch(`/api/skills/${l}`);return i.ok?await i.json():null}catch{return null}},createSkill:async l=>{try{const i=await fetch("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});return i.ok?(await n().fetchSkills(),{success:!0}):{success:!1,error:(await i.json()).error}}catch{return{success:!1,error:"Network error"}}},updateSkill:async(l,i)=>{try{const s=await fetch(`/api/skills/${l}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return s.ok?(await n().fetchSkills(),{success:!0}):{success:!1,error:(await s.json()).error}}catch{return{success:!1,error:"Network error"}}},deleteSkill:async l=>{try{return(await fetch(`/api/skills/${l}`,{method:"DELETE"})).ok?(e({skills:n().skills.filter(s=>s.id!==l)}),!0):!1}catch{return!1}},restoreDefault:async l=>{try{return(await fetch(`/api/skills/${l}/restore-default`,{method:"POST"})).ok?(await n().fetchSkills(),!0):!1}catch{return!1}},restoreAllDefaults:async()=>{try{return(await fetch("/api/skills/restore-all-defaults",{method:"POST"})).ok?(await n().fetchSkills(),!0):!1}catch{return!1}}}));function wk(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function kk({isOpen:e,onClose:n}){const l=pr(Y=>Y.skills),i=pr(Y=>Y.modifiedIds),s=pr(Y=>Y.loading),c=pr(Y=>Y.fetchSkills),d=pr(Y=>Y.toggleSkill),f=pr(Y=>Y.fetchSkill),p=pr(Y=>Y.createSkill),m=pr(Y=>Y.updateSkill),x=pr(Y=>Y.deleteSkill),b=pr(Y=>Y.restoreDefault),y=pr(Y=>Y.restoreAllDefaults),[v,w]=_.useState("list"),[N,j]=_.useState(null),[k,T]=_.useState(null),[C,L]=_.useState(""),[G,I]=_.useState(""),[R,X]=_.useState(""),[U,D]=_.useState("1.0.0"),[Q,M]=_.useState(""),[V,H]=_.useState(""),[q,B]=_.useState(!1),[P,oe]=_.useState(null),[ae,A]=_.useState(!1);_.useEffect(()=>{e&&(c(),w("list"),j(null),T(null),oe(null),A(!1))},[e,c]);const z=()=>{j(null),L(""),I(""),X(""),D("1.0.0"),M(""),H(""),w("edit")},W=async Y=>{const le=await f(Y);le&&(j(Y),L(le.metadata.name),I(le.metadata.id),X(le.metadata.description),D(le.metadata.version),M(le.prompt),H(""),w("edit"))},O=async Y=>{await x(Y),T(null)},$=async()=>{const Y=N??G;if(!Y||!C||!Q){H("Name and prompt are required.");return}B(!0),H("");const le={metadata:{id:Y,name:C,description:R,version:U||"1.0.0"},prompt:Q},xe=N?await m(N,le):await p(le);if(B(!1),!xe.success){H(xe.error??"Failed to save skill.");return}w("list")},ee=()=>{w("list")},re=Y=>{L(Y),N||I(wk(Y))};return v==="edit"?u.jsx(In,{isOpen:e,onClose:ee,title:N?"Edit Skill":"New Skill",size:"lg",children:u.jsxs("div",{className:"space-y-3",children:[V&&u.jsx("div",{className:"text-accent-error text-sm px-3 py-2 bg-accent-error/10 rounded",children:V}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs text-text-secondary mb-1",children:"Name"}),u.jsx("input",{value:C,onChange:Y=>re(Y.target.value),placeholder:"My Skill",className:"w-full px-2 py-1.5 bg-bg-tertiary border border-border rounded text-sm focus:outline-none focus:ring-1 focus:ring-accent-primary"})]}),u.jsxs("div",{children:[u.jsxs("label",{className:"block text-xs text-text-secondary mb-1",children:["ID ",N&&u.jsx("span",{className:"text-text-muted",children:"(read-only)"})]}),u.jsx("input",{value:G,onChange:Y=>!N&&I(Y.target.value),readOnly:!!N,placeholder:"my-skill",className:`w-full px-2 py-1.5 bg-bg-tertiary border border-border rounded text-sm font-mono focus:outline-none focus:ring-1 focus:ring-accent-primary ${N?"opacity-60":""}`})]})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs text-text-secondary mb-1",children:"Description"}),u.jsx("input",{value:R,onChange:Y=>X(Y.target.value),placeholder:"Short description of what this skill provides",className:"w-full px-2 py-1.5 bg-bg-tertiary border border-border rounded text-sm focus:outline-none focus:ring-1 focus:ring-accent-primary"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs text-text-secondary mb-1",children:"Version"}),u.jsx("input",{value:U,onChange:Y=>D(Y.target.value),placeholder:"1.0.0",className:"w-full px-2 py-1.5 bg-bg-tertiary border border-border rounded text-sm font-mono focus:outline-none focus:ring-1 focus:ring-accent-primary"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs text-text-secondary mb-1",children:"Prompt"}),u.jsx("textarea",{value:Q,onChange:Y=>M(Y.target.value),placeholder:"Instructions the agent receives when this skill is loaded...",className:"w-full h-64 px-3 py-2 bg-bg-tertiary border border-border rounded text-sm font-mono resize-none focus:outline-none focus:ring-1 focus:ring-accent-primary"})]}),u.jsxs("div",{className:"flex justify-end gap-2 pt-2 border-t border-border",children:[u.jsx(gt,{variant:"secondary",onClick:ee,children:"Cancel"}),u.jsx(gt,{variant:"primary",onClick:$,disabled:q||!C||!Q,children:q?"Saving...":"Save"})]})]})}):u.jsxs(In,{isOpen:e,onClose:n,title:"Skills",size:"md",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("p",{className:"text-text-secondary text-sm",children:"Skills provide domain-specific knowledge that agents can load on demand."}),u.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 ml-3",children:[i.length>0&&(ae?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:async()=>{await y(),A(!1)},className:"px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400 text-xs hover:bg-amber-500/30 transition-colors",children:"Confirm"}),u.jsx("button",{onClick:()=>A(!1),className:"px-1.5 py-0.5 rounded text-text-muted text-xs hover:bg-bg-primary transition-colors",children:"Cancel"})]}):u.jsx("button",{onClick:()=>A(!0),className:"px-2 py-1 rounded text-xs text-text-muted hover:text-amber-400 hover:bg-amber-500/10 transition-colors",title:"Restore all skills to defaults",children:"Restore Defaults"})),u.jsx(gt,{variant:"primary",size:"sm",onClick:z,children:"+ New"})]})]}),s&&l.length===0?u.jsx("div",{className:"text-text-muted text-sm",children:"Loading skills..."}):l.length===0?u.jsx("div",{className:"text-text-muted text-sm",children:"No skills installed."}):u.jsx("div",{className:"space-y-2",children:l.map(Y=>u.jsxs("div",{className:"flex items-center justify-between p-3 rounded border border-border bg-bg-tertiary",children:[u.jsxs("div",{className:"min-w-0 flex-1 mr-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-text-primary text-sm font-medium",children:Y.name}),u.jsxs("span",{className:"text-text-muted text-xs",children:["v",Y.version]}),i.includes(Y.id)&&u.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-amber-500/15 text-amber-400",children:"modified"})]}),u.jsx("p",{className:"text-text-secondary text-xs mt-0.5 truncate",children:Y.description})]}),u.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[i.includes(Y.id)&&(P===Y.id?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:async()=>{await b(Y.id),oe(null)},className:"px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400 text-xs hover:bg-amber-500/30 transition-colors",children:"Restore"}),u.jsx("button",{onClick:()=>oe(null),className:"px-1.5 py-0.5 rounded text-text-muted text-xs hover:bg-bg-primary transition-colors",children:"Cancel"})]}):u.jsx("button",{onClick:()=>oe(Y.id),className:"p-1.5 rounded hover:bg-bg-primary text-text-muted hover:text-amber-400 transition-colors",title:"Restore default",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})),u.jsx("button",{onClick:()=>W(Y.id),className:"p-1.5 rounded hover:bg-bg-primary text-text-muted hover:text-text-primary transition-colors",title:"Edit skill",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),k===Y.id?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:()=>O(Y.id),className:"px-1.5 py-0.5 rounded bg-accent-error/20 text-accent-error text-xs hover:bg-accent-error/30 transition-colors",children:"Delete"}),u.jsx("button",{onClick:()=>T(null),className:"px-1.5 py-0.5 rounded text-text-muted text-xs hover:bg-bg-primary transition-colors",children:"Cancel"})]}):u.jsx("button",{onClick:()=>T(Y.id),className:"p-1.5 rounded hover:bg-bg-primary text-text-muted hover:text-accent-error transition-colors",title:"Delete skill",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})}),u.jsx("button",{onClick:()=>d(Y.id),className:`relative w-9 h-5 rounded-full transition-colors flex-shrink-0 ml-1 ${Y.enabled?"bg-accent-primary":"bg-bg-primary"}`,title:Y.enabled?"Disable skill":"Enable skill",children:u.jsx("span",{className:`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white transition-transform ${Y.enabled?"translate-x-4":"translate-x-0"}`})})]})]},Y.id))})]})}const jk="#6b7280";function xc(e,n){var l;return((l=e.find(i=>i.id===n))==null?void 0:l.color)??jk}const bn=Kr((e,n)=>({agents:[],defaultIds:[],modifiedIds:[],loading:!1,fetchDefaultIds:async()=>{try{const i=await(await fetch("/api/agents/default-ids")).json();e({defaultIds:i.ids??[]})}catch{}},fetchAgents:async()=>{e({loading:!0});try{const i=await(await fetch("/api/agents")).json();e({agents:i.agents??[],defaultIds:i.defaultIds??n().defaultIds,modifiedIds:i.modifiedIds??[],loading:!1})}catch{e({loading:!1})}},fetchAgent:async l=>{try{const i=await fetch(`/api/agents/${l}`);return i.ok?await i.json():null}catch{return null}},createAgent:async l=>{try{const i=await fetch("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});return i.ok?(await n().fetchAgents(),{success:!0}):{success:!1,error:(await i.json()).error}}catch{return{success:!1,error:"Network error"}}},updateAgent:async(l,i)=>{try{const s=await fetch(`/api/agents/${l}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return s.ok?(await n().fetchAgents(),{success:!0}):{success:!1,error:(await s.json()).error}}catch{return{success:!1,error:"Network error"}}},deleteAgent:async l=>{try{return(await fetch(`/api/agents/${l}`,{method:"DELETE"})).ok?(e({agents:n().agents.filter(s=>s.id!==l)}),!0):!1}catch{return!1}},restoreDefault:async l=>{try{return(await fetch(`/api/agents/${l}/restore-default`,{method:"POST"})).ok?(await n().fetchAgents(),!0):!1}catch{return!1}},restoreAllDefaults:async()=>{try{return(await fetch("/api/agents/restore-all-defaults",{method:"POST"})).ok?(await n().fetchAgents(),!0):!1}catch{return!1}}})),Nk=["read_file","write_file","edit_file","run_command","glob","grep","git","ask_user","web_fetch","complete_criterion","pass_criterion","fail_criterion","get_criteria","add_criterion","update_criterion","remove_criterion","todo_write","call_sub_agent","load_skill"];function Ck(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_|_$/g,"")}function Ek({isOpen:e,onClose:n}){const l=bn(fe=>fe.agents),i=bn(fe=>fe.modifiedIds),s=bn(fe=>fe.loading),c=bn(fe=>fe.fetchAgents),d=bn(fe=>fe.fetchAgent),f=bn(fe=>fe.createAgent),p=bn(fe=>fe.updateAgent),m=bn(fe=>fe.deleteAgent),x=bn(fe=>fe.restoreDefault),b=bn(fe=>fe.restoreAllDefaults),[y,v]=_.useState("list"),[w,N]=_.useState(null),[j,k]=_.useState(null),[T,C]=_.useState(""),[L,G]=_.useState(""),[I,R]=_.useState(""),[X,U]=_.useState(!0),[D,Q]=_.useState([]),[M,V]=_.useState("#6b7280"),[H,q]=_.useState(""),[B,P]=_.useState(""),[oe,ae]=_.useState(!1),[A,z]=_.useState(null),[W,O]=_.useState(!1);_.useEffect(()=>{e&&(c(),v("list"),N(null),k(null),z(null),O(!1))},[e,c]);const $=()=>{N(null),C(""),G(""),R(""),U(!0),Q(["read_file"]),V("#6b7280"),q(""),P(""),v("edit")},ee=async fe=>{const Ce=await d(fe);Ce&&(N(fe),C(Ce.metadata.name),G(Ce.metadata.id),R(Ce.metadata.description),U(Ce.metadata.subagent),Q(Ce.metadata.tools),V(Ce.metadata.color??"#6b7280"),q(Ce.prompt),P(""),v("edit"))},re=async fe=>{await m(fe),k(null)},Y=async()=>{const fe=w??L;if(!fe||!T||!H){P("Name and prompt are required.");return}ae(!0),P("");const Ce={metadata:{id:fe,name:T,description:I,subagent:X,tools:D,color:M},prompt:H},Re=w?await p(w,Ce):await f(Ce);if(ae(!1),!Re.success){P(Re.error??"Failed to save agent.");return}v("list")},le=()=>{v("list")},xe=fe=>{C(fe),w||G(Ck(fe))},Te=fe=>{Q(Ce=>Ce.includes(fe)?Ce.filter(Re=>Re!==fe):[...Ce,fe])};if(y==="edit")return u.jsx(In,{isOpen:e,onClose:le,title:w?"Edit Agent":"New Agent",size:"lg",children:u.jsxs("div",{className:"space-y-3",children:[B&&u.jsx("div",{className:"text-accent-error text-sm px-3 py-2 bg-accent-error/10 rounded",children:B}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs text-text-secondary mb-1",children:"Name"}),u.jsx("input",{value:T,onChange:fe=>xe(fe.target.value),placeholder:"My Agent",className:"w-full px-2 py-1.5 bg-bg-tertiary border border-border rounded text-sm focus:outline-none focus:ring-1 focus:ring-accent-primary"})]}),u.jsxs("div",{children:[u.jsxs("label",{className:"block text-xs text-text-secondary mb-1",children:["ID ",w&&u.jsx("span",{className:"text-text-muted",children:"(read-only)"})]}),u.jsx("input",{value:L,onChange:fe=>!w&&G(fe.target.value),readOnly:!!w,placeholder:"my_agent",className:`w-full px-2 py-1.5 bg-bg-tertiary border border-border rounded text-sm font-mono focus:outline-none focus:ring-1 focus:ring-accent-primary ${w?"opacity-60":""}`})]})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs text-text-secondary mb-1",children:"Description"}),u.jsx("input",{value:I,onChange:fe=>R(fe.target.value),placeholder:"What this agent does",className:"w-full px-2 py-1.5 bg-bg-tertiary border border-border rounded text-sm focus:outline-none focus:ring-1 focus:ring-accent-primary"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs text-text-secondary mb-1",children:"Type"}),u.jsxs("div",{className:"flex items-center gap-3 h-[34px]",children:[u.jsx("button",{onClick:()=>U(!0),className:`px-2.5 py-1 rounded text-xs font-medium transition-colors ${X?"bg-accent-primary/25 text-accent-primary":"bg-bg-tertiary text-text-muted hover:text-text-secondary"}`,children:"Sub-agent"}),u.jsx("button",{onClick:()=>U(!1),className:`px-2.5 py-1 rounded text-xs font-medium transition-colors ${X?"bg-bg-tertiary text-text-muted hover:text-text-secondary":"bg-accent-primary/25 text-accent-primary"}`,children:"Top-level"}),u.jsxs("div",{className:"flex items-center gap-1.5 ml-auto",children:[u.jsx("label",{className:"text-xs text-text-secondary",children:"Color"}),u.jsx("input",{type:"color",value:M,onChange:fe=>V(fe.target.value),className:"w-6 h-6 rounded cursor-pointer border border-border bg-transparent"})]})]})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs text-text-secondary mb-1",children:"Tools"}),u.jsx("div",{className:"flex flex-wrap gap-1.5 p-2 bg-bg-tertiary border border-border rounded max-h-24 overflow-y-auto",children:Nk.map(fe=>u.jsx("button",{onClick:()=>Te(fe),className:`px-1.5 py-0.5 rounded text-xs font-mono transition-colors ${D.includes(fe)?"bg-accent-primary/25 text-accent-primary":"bg-bg-primary text-text-muted hover:text-text-secondary"}`,children:fe},fe))})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs text-text-secondary mb-1",children:"Prompt"}),u.jsx("textarea",{value:H,onChange:fe=>q(fe.target.value),placeholder:"Instructions for this agent...",className:"w-full h-64 px-3 py-2 bg-bg-tertiary border border-border rounded text-sm font-mono resize-none focus:outline-none focus:ring-1 focus:ring-accent-primary"})]}),u.jsxs("div",{className:"flex justify-end gap-2 pt-2 border-t border-border",children:[u.jsx(gt,{variant:"secondary",onClick:le,children:"Cancel"}),u.jsx(gt,{variant:"primary",onClick:Y,disabled:oe||!T||!H,children:oe?"Saving...":"Save"})]})]})});const je=l.filter(fe=>fe.subagent),He=l.filter(fe=>!fe.subagent);return u.jsxs(In,{isOpen:e,onClose:n,title:"Agents",size:"md",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("p",{className:"text-text-secondary text-sm",children:"Agents define behavior, tools, and prompts for top-level modes and sub-agents."}),u.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 ml-3",children:[i.length>0&&(W?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:async()=>{await b(),O(!1)},className:"px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400 text-xs hover:bg-amber-500/30 transition-colors",children:"Confirm"}),u.jsx("button",{onClick:()=>O(!1),className:"px-1.5 py-0.5 rounded text-text-muted text-xs hover:bg-bg-primary transition-colors",children:"Cancel"})]}):u.jsx("button",{onClick:()=>O(!0),className:"px-2 py-1 rounded text-xs text-text-muted hover:text-amber-400 hover:bg-amber-500/10 transition-colors",title:"Restore all agents to defaults",children:"Restore Defaults"})),u.jsx(gt,{variant:"primary",size:"sm",onClick:$,children:"+ New"})]})]}),s&&l.length===0?u.jsx("div",{className:"text-text-muted text-sm",children:"Loading agents..."}):l.length===0?u.jsx("div",{className:"text-text-muted text-sm",children:"No agents defined."}):u.jsxs("div",{className:"space-y-4",children:[He.length>0&&u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-text-muted uppercase tracking-wider mb-1.5",children:"Top-level"}),u.jsx("div",{className:"space-y-2",children:He.map(fe=>u.jsx(Mb,{agent:fe,confirmDeleteId:j,isModified:i.includes(fe.id),confirmRestoreId:A,onRestore:async()=>{await x(fe.id),z(null)},onConfirmRestore:()=>z(fe.id),onCancelRestore:()=>z(null),onEdit:()=>ee(fe.id),onDelete:()=>re(fe.id),onConfirmDelete:()=>k(fe.id),onCancelDelete:()=>k(null)},fe.id))})]}),je.length>0&&u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-text-muted uppercase tracking-wider mb-1.5",children:"Sub-agents"}),u.jsx("div",{className:"space-y-2",children:je.map(fe=>u.jsx(Mb,{agent:fe,confirmDeleteId:j,isModified:i.includes(fe.id),confirmRestoreId:A,onRestore:async()=>{await x(fe.id),z(null)},onConfirmRestore:()=>z(fe.id),onCancelRestore:()=>z(null),onEdit:()=>ee(fe.id),onDelete:()=>re(fe.id),onConfirmDelete:()=>k(fe.id),onCancelDelete:()=>k(null)},fe.id))})]})]})]})}function Mb({agent:e,confirmDeleteId:n,isModified:l,confirmRestoreId:i,onRestore:s,onConfirmRestore:c,onCancelRestore:d,onEdit:f,onDelete:p,onConfirmDelete:m,onCancelDelete:x}){return u.jsxs("div",{className:"flex items-center justify-between p-3 rounded border border-border bg-bg-tertiary",children:[u.jsxs("div",{className:"min-w-0 flex-1 mr-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:e.color??"#6b7280"}}),u.jsx("span",{className:"text-text-primary text-sm font-medium",children:e.name}),u.jsx("span",{className:"text-text-muted text-xs font-mono",children:e.id}),l&&u.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-amber-500/15 text-amber-400",children:"modified"})]}),e.description&&u.jsx("p",{className:"text-text-secondary text-xs mt-0.5 truncate",children:e.description}),u.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.tools.slice(0,5).map(b=>u.jsx("span",{className:"text-[10px] font-mono text-text-muted bg-bg-primary px-1 py-0.5 rounded",children:b},b)),e.tools.length>5&&u.jsxs("span",{className:"text-[10px] text-text-muted",children:["+",e.tools.length-5," more"]})]})]}),u.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[l&&(i===e.id?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:s,className:"px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400 text-xs hover:bg-amber-500/30 transition-colors",children:"Restore"}),u.jsx("button",{onClick:d,className:"px-1.5 py-0.5 rounded text-text-muted text-xs hover:bg-bg-primary transition-colors",children:"Cancel"})]}):u.jsx("button",{onClick:c,className:"p-1.5 rounded hover:bg-bg-primary text-text-muted hover:text-amber-400 transition-colors",title:"Restore default",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})),u.jsx("button",{onClick:f,className:"p-1.5 rounded hover:bg-bg-primary text-text-muted hover:text-text-primary transition-colors",title:"Edit agent",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),n===e.id?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:p,className:"px-1.5 py-0.5 rounded bg-accent-error/20 text-accent-error text-xs hover:bg-accent-error/30 transition-colors",children:"Delete"}),u.jsx("button",{onClick:x,className:"px-1.5 py-0.5 rounded text-text-muted text-xs hover:bg-bg-primary transition-colors",children:"Cancel"})]}):u.jsx("button",{onClick:m,className:"p-1.5 rounded hover:bg-bg-primary text-text-muted hover:text-accent-error transition-colors",title:"Delete agent",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]})}const Ln=Kr((e,n)=>({workflows:[],defaultIds:[],modifiedIds:[],activeWorkflowId:"default",loading:!1,fetchDefaultIds:async()=>{try{const i=await(await fetch("/api/workflows/default-ids")).json();e({defaultIds:i.ids??[]})}catch{}},fetchWorkflows:async()=>{e({loading:!0});try{const i=await(await fetch("/api/workflows")).json();e({workflows:i.workflows??[],activeWorkflowId:i.activeWorkflowId??"default",defaultIds:i.defaultIds??n().defaultIds,modifiedIds:i.modifiedIds??[],loading:!1})}catch{e({loading:!1})}},fetchWorkflow:async l=>{try{const i=await fetch(`/api/workflows/${l}`);return i.ok?await i.json():null}catch{return null}},createWorkflow:async l=>{try{const i=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});return i.ok?(await n().fetchWorkflows(),{success:!0}):{success:!1,error:(await i.json()).error}}catch{return{success:!1,error:"Network error"}}},updateWorkflow:async(l,i)=>{try{const s=await fetch(`/api/workflows/${l}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return s.ok?(await n().fetchWorkflows(),{success:!0}):{success:!1,error:(await s.json()).error}}catch{return{success:!1,error:"Network error"}}},deleteWorkflow:async l=>{try{return(await fetch(`/api/workflows/${l}`,{method:"DELETE"})).ok?(e({workflows:n().workflows.filter(s=>s.id!==l)}),!0):!1}catch{return!1}},restoreDefault:async l=>{try{return(await fetch(`/api/workflows/${l}/restore-default`,{method:"POST"})).ok?(await n().fetchWorkflows(),!0):!1}catch{return!1}},restoreAllDefaults:async()=>{try{return(await fetch("/api/workflows/restore-all-defaults",{method:"POST"})).ok?(await n().fetchWorkflows(),!0):!1}catch{return!1}}}));function Tk(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Ak(e){let n=1;for(;e.some(l=>l.id===`s${n}`);)n++;return`s${n}`}const Ok=[{value:"agent",label:"Agent"},{value:"sub_agent",label:"Sub-Agent"},{value:"shell",label:"Shell"}],M0={all_criteria_passed:"All passed",all_criteria_completed_or_passed:"All completed",any_criteria_blocked:"Blocked",has_pending_criteria:"Pending/Failed",step_result:"Result",always:"Always"},z0=[{value:"all_criteria_passed",label:"All criteria passed"},{value:"all_criteria_completed_or_passed",label:"All criteria completed or passed"},{value:"any_criteria_blocked",label:"Any criteria blocked (retry limit)"},{value:"has_pending_criteria",label:"Has pending or failed criteria"},{value:"step_result",label:"Step result is..."},{value:"always",label:"Always (fallback)"}],Wl=150,Vr=54,Ki=80,Yn=30,Wi=70,zb=100,Jl=50,nc=50,Db=4;function hm(e,n){if(e.type==="agent"){const l=n.find(i=>i.id===e.toolMode);return{name:(l==null?void 0:l.name)??(e.toolMode||"Agent"),color:(l==null?void 0:l.color)||"#3b82f6"}}if(e.type==="sub_agent"){const l=n.find(i=>i.id===e.subAgentType);return{name:(l==null?void 0:l.name)??(e.subAgentType||"Sub-Agent"),color:(l==null?void 0:l.color)||"#a855f7"}}return{name:"Shell",color:"#22c55e"}}function _k(e,n,l,i){const s=nc+Jl+Wl+zb+Wl+Jl+nc,c=s/2,d=nc+Jl+Wl/2,f=nc+Jl+Wl+zb+Wl/2,p=[],m=[],x=new Map,b=e.filter(H=>H.type==="agent"||H.type==="shell"),y=e.filter(H=>H.type==="sub_agent"),v=y.length>0,w=v?d:c,N=b.length>0?f:c,j=Jl+Yn/2;if(p.push({id:"$start",type:"terminal",label:"Start",cx:w,cy:j,w:Ki,h:Yn}),x.set("$start",{cx:w,cy:j,w:Ki,h:Yn}),e.length===0){const H=j+Yn/2+Wi*2+Yn/2;return p.push({id:"$done",type:"terminal",label:"Done",cx:w,cy:H,w:Ki,h:Yn}),x.set("$done",{cx:w,cy:H,w:Ki,h:Yn}),{nodes:p,edges:m,width:s,height:H+Yn/2+Jl,posMap:x}}const k=j+Yn/2+Wi,T=(H,q)=>{H.forEach((B,P)=>{const oe=k+P*(Vr+Wi)+Vr/2,{name:ae,color:A}=hm(B,i);p.push({id:B.id,type:"step",label:ae,color:A,cx:q,cy:oe,w:Wl,h:Vr}),x.set(B.id,{cx:q,cy:oe,w:Wl,h:Vr})})};T(b,w),T(y,N);const C=b.length>0?k+(b.length-1)*(Vr+Wi)+Vr/2:j,L=v?k+(y.length-1)*(Vr+Wi)+Vr/2:j,G=Math.max(C,L)+Vr/2+Wi+Yn/2;p.push({id:"$done",type:"terminal",label:"Done",cx:w,cy:G,w:Ki,h:Yn}),x.set("$done",{cx:w,cy:G,w:Ki,h:Yn});const I=[];n&&x.has(n)&&I.push({from:"$start",to:n,label:l,edgeKey:"start",direction:"down",backEdgeIndex:0});let R=0;for(const H of e)H.transitions.forEach((q,B)=>{if(!q.goto||!x.has(q.goto))return;const P=x.get(H.id),oe=x.get(q.goto),ae=q.when.type==="step_result"?`${q.when.result}`:M0[q.when.type]??q.when.type,A=H.id===q.goto;let z;A?z="back":oe.cy>P.cy+1?z="down":oe.cy<P.cy-1?z="back":z="same",I.push({from:H.id,to:q.goto,label:ae,edgeKey:`${H.id}:${B}`,direction:z,backEdgeIndex:z==="back"?R++:0})});const X=new Map,U=new Map,D=new Map,Q=new Map;for(const H of I)H.direction==="down"&&(X.set(H.from,(X.get(H.from)??0)+1),U.set(H.to,(U.get(H.to)??0)+1));const M=new Map,V=new Map;for(const H of I){if(H.direction!=="same")continue;const q=[H.from,H.to].sort().join("|");M.set(q,(M.get(q)??0)+1)}for(const H of I){if(H.direction==="back"||H.direction==="same"){let z=0;if(H.direction==="same"){const W=[H.from,H.to].sort().join("|");z=V.get(W)??0,V.set(W,z+1)}m.push({...H,fromPort:0,toPort:0,sameEdgeIndex:z});continue}const q=X.get(H.from)??1,B=U.get(H.to)??1,P=D.get(H.from)??0,oe=Q.get(H.to)??0;D.set(H.from,P+1),Q.set(H.to,oe+1);const ae=q===1?0:-.6+1.2*P/(q-1),A=B===1?0:-.6+1.2*oe/(B-1);m.push({...H,fromPort:ae,toPort:A,sameEdgeIndex:0})}return{nodes:p,edges:m,width:s,height:G+Yn/2+Jl,posMap:x}}function Rk({steps:e,entryStep:n,selectedNodeId:l,selectedEdgeKey:i,startConditionLabel:s,agentTypes:c,onSelectNode:d,onSelectEdge:f,onRemoveStep:p,onCreateTransition:m,onReconnectTo:x,onReconnectFrom:b,onDeleteTransition:y}){const v=_.useRef(null),w=_.useRef(!1),[N,j]=_.useState(null),[k,T]=_.useState(null),[C,L]=_.useState(null),{nodes:G,edges:I,width:R,height:X,posMap:U}=_.useMemo(()=>_k(e,n,s,c),[e,n,s,c]),D=_.useCallback($=>{var xe;const ee=v.current;if(!ee)return{x:0,y:0};const re=ee.createSVGPoint();re.x=$.clientX,re.y=$.clientY;const Y=(xe=ee.getScreenCTM())==null?void 0:xe.inverse();if(!Y)return{x:0,y:0};const le=re.matrixTransform(Y);return{x:le.x,y:le.y}},[]),Q=_.useCallback($=>!$||!k||$==="$start"?!1:k.type==="reconnect-from"?$!=="$done":!0,[k]),M=_.useCallback(($,ee)=>{$.stopPropagation(),$.preventDefault();const re=D($);T({type:"new",fromNodeId:ee,mouseX:re.x,mouseY:re.y})},[D]),V=_.useCallback(($,ee)=>{$.stopPropagation(),$.preventDefault();const re=D($);T({type:"reconnect-to",fromNodeId:ee.from,edgeKey:ee.edgeKey,mouseX:re.x,mouseY:re.y})},[D]),H=_.useCallback(($,ee)=>{$.stopPropagation(),$.preventDefault();const re=D($);T({type:"reconnect-from",fromNodeId:ee.from,fixedTargetId:ee.to,edgeKey:ee.edgeKey,mouseX:re.x,mouseY:re.y})},[D]),q=_.useCallback($=>{if(!k)return;const ee=D($);T(re=>re?{...re,mouseX:ee.x,mouseY:ee.y}:null)},[k,D]),B=_.useCallback(()=>{k&&(w.current=!0,C&&Q(C)&&(k.type==="new"?m(k.fromNodeId,C):k.type==="reconnect-to"?x(k.edgeKey,C):k.type==="reconnect-from"&&b(k.edgeKey,C)),T(null),L(null))},[k,C,Q,m,x,b]),P=_.useCallback(()=>{if(w.current){w.current=!1;return}d(null),f(null)},[d,f]);_.useEffect(()=>{const $=ee=>{ee.target instanceof HTMLInputElement||ee.target instanceof HTMLTextAreaElement||ee.target instanceof HTMLSelectElement||(ee.key==="Delete"||ee.key==="Backspace")&&i&&i!=="start"&&(ee.preventDefault(),y(i),f(null))};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[i,y,f]);const oe=$=>{const ee=U.get($.from),re=U.get($.to);if(!ee||!re)return null;let Y,le,xe,Te="middle",je,He;if($.direction==="down"){const fe=ee.cx+$.fromPort*(ee.w/2-10),Ce=ee.cy+ee.h/2,Re=re.cx+$.toPort*(re.w/2-10),$e=re.cy-re.h/2,Je=$e-Ce,Ge=Re-fe;Y=`M ${fe} ${Ce} C ${fe} ${Ce+Je*.4}, ${Re-Ge*.2} ${$e-Je*.1}, ${Re} ${$e}`,le=fe+(Re-fe)*.5,xe=Ce+Je*.6,je={x:fe,y:Ce},He={x:Re,y:$e}}else if($.direction==="back"){const fe=$.from===$.to,Ce=ee.cx>=R/2,Re=$.backEdgeIndex*16,$e=Ce?R-20-Re:20+Re;if(fe){const Je=ee.cx>=R/2,Ge=30+$.backEdgeIndex*14,vt=ee.cy-ee.h/2,Tt=Je?ee.cx+ee.w/2:ee.cx-ee.w/2,Gt=Je?Tt+Ge:Tt-Ge,en=ee.cx+(Je?ee.w/4:-ee.w/4),At=vt-20-$.backEdgeIndex*10;Y=`M ${Tt} ${ee.cy} C ${Gt} ${ee.cy}, ${Gt} ${At}, ${en} ${vt}`,le=Gt+10,xe=At+4,Te="middle",je={x:Tt,y:ee.cy},He={x:en,y:vt}}else{const Je=Ce?ee.cx+ee.w/2:ee.cx-ee.w/2,Ge=re.cx+(Ce?re.w/4:-re.w/4),vt=Math.min(ee.cy,re.cy)-re.h/2-18-$.backEdgeIndex*14;Y=`M ${Je} ${ee.cy} L ${$e} ${ee.cy} L ${$e} ${vt} L ${Ge} ${vt} L ${Ge} ${re.cy-re.h/2}`,le=$e,xe=(ee.cy+vt)/2,Te=Ce?"start":"end",je={x:Je,y:ee.cy},He={x:Ge,y:re.cy-re.h/2}}}else{const fe=re.cx>ee.cx,Ce=$.sameEdgeIndex===0?-12:12,Re=fe?ee.cx+ee.w/2:ee.cx-ee.w/2,$e=fe?re.cx-re.w/2:re.cx+re.w/2,Je=ee.cy+Ce,Ge=re.cy+Ce,vt=(Re+$e)/2;Y=`M ${Re} ${Je} C ${vt} ${Je}, ${vt} ${Ge}, ${$e} ${Ge}`,le=vt,xe=(Je+Ge)/2-6,je={x:Re,y:Je},He={x:$e,y:Ge}}return{path:Y,labelX:le,labelY:xe,labelAnchor:Te,fromPt:je,toPt:He}},ae=($,ee)=>{const re=oe($);if(!re)return null;const{path:Y,labelX:le,labelY:xe,labelAnchor:Te}=re,je=i===$.edgeKey,He=$.label&&!($.from==="$start"&&$.label==="Always");return u.jsxs("g",{children:[u.jsx("path",{d:Y,fill:"none",stroke:"transparent",strokeWidth:14,className:"cursor-pointer",onClick:fe=>{fe.stopPropagation(),f(je?null:$.edgeKey)}}),u.jsx("path",{d:Y,fill:"none",stroke:je?"#58a6ff":"#484f58",strokeWidth:je?2.2:1.2,markerEnd:je?"url(#arrow-selected)":"url(#arrow)",pointerEvents:"none"}),He&&u.jsx("text",{x:le+(Te==="start"?5:Te==="end"?-5:0),y:xe+3,textAnchor:Te,className:"text-[8px]",fill:je?"#79c0ff":"#8b949e",style:{paintOrder:"stroke",stroke:"#0d1117",strokeWidth:3,strokeLinejoin:"round"},pointerEvents:"none",children:$.label})]},ee)},A=()=>{if(!i||k)return null;const $=I.find(xe=>xe.edgeKey===i);if(!$)return null;const ee=oe($);if(!ee)return null;const{fromPt:re,toPt:Y}=ee,le=6;return u.jsxs(u.Fragment,{children:[$.edgeKey!=="start"&&u.jsx("circle",{cx:re.x,cy:re.y,r:le,fill:"#58a6ff",fillOpacity:.25,stroke:"#58a6ff",strokeWidth:2,strokeOpacity:.8,className:"cursor-grab",onMouseDown:xe=>H(xe,$)}),u.jsx("circle",{cx:Y.x,cy:Y.y,r:le,fill:"#58a6ff",fillOpacity:.25,stroke:"#58a6ff",strokeWidth:2,strokeOpacity:.8,className:"cursor-grab",onMouseDown:xe=>V(xe,$)})]})},z=()=>{if(!k)return null;let $,ee,re,Y;if(k.type==="reconnect-from"){const Te=U.get(k.fixedTargetId);if(!Te)return null;$=k.mouseX,ee=k.mouseY,re=Te.cx,Y=Te.cy-Te.h/2}else{const Te=U.get(k.fromNodeId);if(!Te)return null;$=Te.cx,ee=Te.cy+Te.h/2,re=k.mouseX,Y=k.mouseY}const le=Y-ee,xe=Math.abs(le)>10?`M ${$} ${ee} C ${$} ${ee+le*.4}, ${re} ${Y-le*.4}, ${re} ${Y}`:`M ${$} ${ee} L ${re} ${Y}`;return u.jsx("path",{d:xe,fill:"none",stroke:"#58a6ff",strokeWidth:2,strokeDasharray:"6 3",strokeOpacity:.7,pointerEvents:"none"})},W=$=>{const ee=$.cy+$.h/2,re=(k==null?void 0:k.fromNodeId)===$.id;return u.jsx("circle",{cx:$.cx,cy:ee,r:Db,fill:re?"#58a6ff":"#1c2128",stroke:re?"#58a6ff":"#484f58",strokeWidth:1.5,strokeOpacity:re?1:.5,className:"cursor-crosshair",onMouseDown:Y=>M(Y,$.id)})},O=$=>{const ee=$.cy-$.h/2,re=k&&C===$.id&&Q($.id);return u.jsx("circle",{cx:$.cx,cy:ee,r:Db,fill:re?"#3fb950":"#1c2128",stroke:re?"#3fb950":"#484f58",strokeWidth:1.5,strokeOpacity:re?1:.5})};return u.jsxs("svg",{ref:v,viewBox:`0 0 ${R} ${X}`,className:"block w-full",preserveAspectRatio:"xMidYMin meet",onMouseMove:q,onMouseUp:B,onClick:P,children:[u.jsxs("defs",{children:[u.jsx("marker",{id:"arrow",viewBox:"0 0 10 7",refX:"10",refY:"3.5",markerWidth:"7",markerHeight:"5",orient:"auto",children:u.jsx("polygon",{points:"0 0, 10 3.5, 0 7",fill:"#484f58"})}),u.jsx("marker",{id:"arrow-selected",viewBox:"0 0 10 7",refX:"10",refY:"3.5",markerWidth:"7",markerHeight:"5",orient:"auto",children:u.jsx("polygon",{points:"0 0, 10 3.5, 0 7",fill:"#58a6ff"})})]}),I.map(($,ee)=>ae($,ee)),G.map($=>{const ee=l===$.id,re=$.cx-$.w/2,Y=$.cy-$.h/2,le=N===$.id,xe=k&&C===$.id&&Q($.id);if($.type==="terminal"){const je=$.id==="$start",He=je?"#58a6ff":"#3fb950",fe=je,Ce=!je;return u.jsxs("g",{onClick:Re=>{Re.stopPropagation(),je&&f("start")},className:je?"cursor-pointer":void 0,children:[xe&&u.jsx("rect",{x:re-3,y:Y-3,width:$.w+6,height:$.h+6,rx:$.h/2+3,fill:"none",stroke:"#3fb950",strokeOpacity:.6,strokeWidth:2}),je&&i==="start"&&u.jsx("rect",{x:re-3,y:Y-3,width:$.w+6,height:$.h+6,rx:$.h/2+3,fill:"none",stroke:"#58a6ff",strokeOpacity:.5,strokeWidth:2}),u.jsx("rect",{x:re,y:Y,width:$.w,height:$.h,rx:$.h/2,fill:He,fillOpacity:.08,stroke:He,strokeOpacity:.4,strokeWidth:1.5}),u.jsx("text",{x:$.cx,y:$.cy+4,textAnchor:"middle",fill:He,className:"text-[10px] font-medium",pointerEvents:"none",children:$.label}),fe&&W($),Ce&&O($)]},$.id)}const Te=$.color??"#6b7280";return u.jsxs("g",{onClick:je=>{je.stopPropagation(),d(ee?null:$.id)},onMouseEnter:()=>j($.id),onMouseLeave:()=>j(null),className:"cursor-pointer",children:[xe&&u.jsx("rect",{x:re-3,y:Y-3,width:$.w+6,height:$.h+6,rx:12,fill:"none",stroke:"#3fb950",strokeOpacity:.6,strokeWidth:2}),ee&&u.jsx("rect",{x:re-3,y:Y-3,width:$.w+6,height:$.h+6,rx:12,fill:"none",stroke:"#58a6ff",strokeOpacity:.5,strokeWidth:2}),u.jsx("rect",{x:re,y:Y,width:$.w,height:$.h,rx:10,fill:Te,fillOpacity:.08,stroke:Te,strokeOpacity:.6,strokeWidth:ee?2:1.5}),u.jsx("text",{x:$.cx,y:$.cy+4,textAnchor:"middle",fill:"#c9d1d9",className:"text-[11px] font-medium",pointerEvents:"none",children:$.label}),W($),O($),le&&!k&&u.jsxs("g",{onClick:je=>{je.stopPropagation(),p($.id)},className:"cursor-pointer",children:[u.jsx("circle",{cx:re+$.w-2,cy:Y+2,r:8,fill:"#0d1117",fillOpacity:.9,stroke:"#f85149",strokeOpacity:.5,strokeWidth:1}),u.jsx("line",{x1:re+$.w-5,y1:Y-1,x2:re+$.w+1,y2:Y+5,stroke:"#f85149",strokeWidth:1.5,strokeLinecap:"round"}),u.jsx("line",{x1:re+$.w+1,y1:Y-1,x2:re+$.w-5,y2:Y+5,stroke:"#f85149",strokeWidth:1.5,strokeLinecap:"round"})]})]},$.id)}),k&&G.map($=>Q($.id)?u.jsx("rect",{x:$.cx-$.w/2-8,y:$.cy-$.h/2-8,width:$.w+16,height:$.h+16,fill:"transparent",rx:12,onMouseEnter:()=>L($.id),onMouseLeave:()=>L(null),onMouseUp:ee=>{ee.stopPropagation(),B()}},`drop-${$.id}`):null),z(),A()]})}const Xr="w-full px-2 py-1.5 bg-bg-tertiary border border-border rounded text-sm focus:outline-none focus:ring-1 focus:ring-accent-primary",ri="w-full px-2 py-1.5 bg-bg-tertiary border border-border rounded text-sm focus:outline-none focus:ring-1 focus:ring-accent-primary",hn="block text-[11px] text-text-secondary mb-0.5";function Mk({fromLabel:e,toLabel:n,condition:l,onUpdateCondition:i,onDelete:s}){return u.jsxs("div",{className:"space-y-3 text-sm",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-semibold bg-blue-500/15 text-blue-300",children:"Transition"}),u.jsx("button",{onClick:s,className:"p-1 rounded text-text-muted hover:text-accent-error text-xs",children:"Delete"})]}),u.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-text-secondary",children:[u.jsx("span",{className:"font-medium text-text-primary",children:e}),u.jsx("svg",{className:"w-3.5 h-3.5 shrink-0 text-text-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})}),u.jsx("span",{className:"font-medium text-text-primary",children:n})]}),u.jsxs("div",{children:[u.jsx("label",{className:hn,children:"Condition"}),u.jsx("select",{value:l.type,onChange:c=>{i(c.target.value==="step_result"?{type:"step_result",result:"success"}:{type:c.target.value})},className:ri,children:z0.map(c=>u.jsx("option",{value:c.value,children:c.label},c.value))})]}),l.type==="step_result"&&u.jsxs("div",{children:[u.jsx("label",{className:hn,children:"Result"}),u.jsxs("select",{value:l.result??"success",onChange:c=>{i({type:"step_result",result:c.target.value})},className:ri,children:[u.jsx("option",{value:"success",children:"success"}),u.jsx("option",{value:"failure",children:"failure"})]})]}),u.jsx("p",{className:"text-text-muted text-[10px]",children:"Drag handles to reconnect. Press Delete to remove."})]})}function zk({step:e,isEntry:n,agentTypes:l,transitionCount:i,onUpdate:s,onRemove:c,onSetEntry:d}){const{color:f,name:p}=hm(e,l);return u.jsxs("div",{className:"space-y-3 text-sm",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-semibold",style:{backgroundColor:f+"20",color:f},children:p}),n&&u.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-semibold bg-accent-primary/15 text-accent-primary",children:"Entry"})]}),u.jsxs("div",{className:"flex items-center gap-1",children:[!n&&u.jsx("button",{onClick:d,className:"p-1 rounded text-text-muted hover:text-accent-primary text-xs",children:"Set entry"}),u.jsx("button",{onClick:c,className:"p-1 rounded text-text-muted hover:text-accent-error text-xs",children:"Delete"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:hn,children:"Type"}),u.jsx("select",{value:e.type,onChange:m=>{const x=m.target.value,b=x==="sub_agent"?"verification":"build";if(x==="agent"){const y=l.find(v=>!v.subagent);s({...e,type:x,phase:b,toolMode:(y==null?void 0:y.id)??"builder",name:(y==null?void 0:y.name)??"Agent"})}else if(x==="sub_agent"){const y=l.find(v=>v.subagent);s({...e,type:x,phase:b,subAgentType:(y==null?void 0:y.id)??"",name:(y==null?void 0:y.name)??"Sub-Agent"})}else s({...e,type:x,phase:b,name:"Shell"})},className:ri,children:Ok.map(m=>u.jsx("option",{value:m.value,children:m.label},m.value))})]}),e.type==="agent"&&u.jsxs("div",{children:[u.jsx("label",{className:hn,children:"Agent Type"}),u.jsx("select",{value:e.toolMode??"builder",onChange:m=>{const x=l.find(b=>b.id===m.target.value);s({...e,toolMode:m.target.value,name:(x==null?void 0:x.name)??m.target.value})},className:ri,children:l.filter(m=>!m.subagent).map(m=>u.jsx("option",{value:m.id,children:m.name},m.id))})]}),e.type==="sub_agent"&&u.jsxs("div",{children:[u.jsx("label",{className:hn,children:"Sub-Agent Type"}),u.jsxs("select",{value:e.subAgentType??"",onChange:m=>{const x=l.find(b=>b.id===m.target.value);s({...e,subAgentType:m.target.value,name:(x==null?void 0:x.name)??m.target.value})},className:ri,children:[u.jsx("option",{value:"",children:"— select —"}),l.filter(m=>m.subagent).map(m=>u.jsx("option",{value:m.id,children:m.name},m.id))]})]}),(e.type==="agent"||e.type==="sub_agent")&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("label",{className:hn,children:"Prompt"}),u.jsx("textarea",{value:e.prompt??"",onChange:m=>s({...e,prompt:m.target.value||void 0}),rows:6,className:`${Xr} resize-y text-xs`,placeholder:"Injected on first entry. Supports {{summary}}, {{criteriaList}}, {{modifiedFiles}}, {{workdir}}, {{reason}}, {{criteriaCount}}, {{pendingCount}}..."})]}),u.jsxs("div",{children:[u.jsx("label",{className:hn,children:"Nudge Prompt"}),u.jsx("textarea",{value:e.nudgePrompt??"",onChange:m=>s({...e,nudgePrompt:m.target.value||void 0}),rows:6,className:`${Xr} resize-y text-xs`,placeholder:"Injected on re-entry. Supports {{verifierFindings}}, {{previousStepOutput}} and all prompt variables..."})]})]}),e.type==="shell"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("label",{className:hn,children:"Command"}),u.jsx("textarea",{value:e.command??"",onChange:m=>s({...e,command:m.target.value}),rows:3,className:`${Xr} font-mono text-xs resize-y`,placeholder:"cd {{workdir}} && npm run lint"})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[u.jsxs("div",{children:[u.jsx("label",{className:hn,children:"Timeout (ms)"}),u.jsx("input",{type:"number",value:e.timeout??6e4,onChange:m=>s({...e,timeout:Number(m.target.value)}),className:`${Xr} font-mono text-xs`})]}),u.jsxs("div",{children:[u.jsx("label",{className:hn,children:"Success Codes"}),u.jsx("input",{value:(e.successExitCodes??[0]).join(", "),onChange:m=>s({...e,successExitCodes:m.target.value.split(",").map(x=>Number(x.trim())).filter(x=>!isNaN(x))}),className:`${Xr} font-mono text-xs`})]})]})]}),u.jsx("div",{className:"pt-1 border-t border-border/50",children:u.jsxs("p",{className:"text-text-muted text-[10px]",children:[i," outgoing transition",i!==1?"s":""," — drag from the bottom port to connect."]})})]})}const Lb=[];function Dk({isOpen:e,onClose:n}){const l=Ln(ue=>ue.workflows),i=Ln(ue=>ue.modifiedIds),s=Ln(ue=>ue.loading),c=Ln(ue=>ue.fetchWorkflows),d=Ln(ue=>ue.fetchWorkflow),f=Ln(ue=>ue.createWorkflow),p=Ln(ue=>ue.updateWorkflow),m=Ln(ue=>ue.deleteWorkflow),x=Ln(ue=>ue.restoreDefault),b=Ln(ue=>ue.restoreAllDefaults),[y,v]=_.useState("list"),[w,N]=_.useState(null),[j,k]=_.useState(null),[T,C]=_.useState(null),[L,G]=_.useState(null),[I,R]=_.useState(""),[X,U]=_.useState(""),[D,Q]=_.useState(""),[M,V]=_.useState("1.0.0"),[H,q]=_.useState("#3b82f6"),[B,P]=_.useState(""),[oe,ae]=_.useState(50),[A,z]=_.useState(Lb),[W,O]=_.useState({type:"always"}),[$,ee]=_.useState(""),[re,Y]=_.useState(!1),[le,xe]=_.useState([]),[Te,je]=_.useState(null),[He,fe]=_.useState(!1);_.useEffect(()=>{e&&(c(),fetch("/api/agents").then(ue=>ue.json()).then(ue=>xe(ue.agents??[])).catch(()=>{}),v("list"),N(null),k(null),je(null),fe(!1),C(null),G(null))},[e,c]);const Ce=()=>{N(null),R(""),U(""),Q(""),V("1.0.0"),q("#3b82f6"),P(""),ae(50),z(structuredClone(Lb)),O({type:"always"}),ee(""),C(null),G(null),v("edit")},Re=async ue=>{const ge=await d(ue);ge&&(N(ue),R(ge.metadata.name),U(ge.metadata.id),Q(ge.metadata.description),V(ge.metadata.version),q(ge.metadata.color??"#3b82f6"),P(ge.entryStep),ae(ge.settings.maxIterations),z(ge.steps),O(ge.startCondition??{type:"always"}),ee(""),C(null),G(null),v("edit"))},$e=async()=>{var qe;const ue=w??X;if(!ue||!I)return ee("Name is required."),!1;if(A.length===0)return ee("Add at least one step."),!1;let ge=B;if(!ge||!A.some(at=>at.id===ge)){if(ge=((qe=A.find(at=>at.id))==null?void 0:qe.id)??"",!ge)return ee("All steps need an ID."),!1;P(ge)}Y(!0),ee("");const we={metadata:{id:ue,name:I,description:D,version:M||"1.0.0",color:H},entryStep:ge,settings:{maxIterations:oe},steps:A,startCondition:W},Le=w?await p(w,we):await f(we);return Y(!1),Le.success?(w||N(ue),!0):(ee(Le.error??"Failed to save."),!1)},Je=async()=>{await $e()},Ge=async()=>{await $e()&&v("list")},vt=ue=>{R(ue),w||U(Tk(ue))},Tt=_.useCallback(ue=>{C(ue),G(null)},[]),Gt=_.useCallback(ue=>{G(ue),C(null)},[]),en=T!==null?Number(T):-1,At=en>=0?A[en]??null:null,Ot=_.useCallback(ue=>{z(ge=>ge.map((we,Le)=>Le===en?ue:we))},[en]),kn=W.type==="step_result"?`${W.result}`:M0[W.type]??W.type,ce=()=>{const ue=A.length,ge=Ak(A),we=le.find(Le=>!Le.subagent);z([...A,{id:ge,name:(we==null?void 0:we.name)??"Agent",type:"agent",phase:"build",toolMode:(we==null?void 0:we.id)??"builder",transitions:[]}]),B||P(ge),Tt(String(ue))},ve=_.useCallback((ue,ge)=>{ue==="$start"?(P(ge),Gt("start")):z(we=>{const Le=we.find(at=>at.id===ue),qe=Le?Le.transitions.length:0;return Gt(`${ue}:${qe}`),we.map(at=>at.id===ue?{...at,transitions:[...at.transitions,{when:{type:"always"},goto:ge}]}:at)})},[Gt]),Me=_.useCallback((ue,ge)=>{if(ue==="start")P(ge);else{const we=ue.lastIndexOf(":"),Le=ue.slice(0,we),qe=parseInt(ue.slice(we+1));z(at=>at.map(qt=>qt.id===Le?{...qt,transitions:qt.transitions.map((Bt,Vt)=>Vt===qe?{...Bt,goto:ge}:Bt)}:qt))}},[]),K=_.useCallback((ue,ge)=>{const we=ue.lastIndexOf(":"),Le=ue.slice(0,we),qe=parseInt(ue.slice(we+1));z(at=>{const qt=at.find(Vt=>Vt.id===Le);if(!qt)return at;const Bt=qt.transitions[qe];return Bt?at.map(Vt=>Vt.id===Le?{...Vt,transitions:Vt.transitions.filter((Jr,fi)=>fi!==qe)}:Vt.id===ge?{...Vt,transitions:[...Vt.transitions,Bt]}:Vt):at}),G(null)},[]),Se=_.useCallback(ue=>{if(ue==="start")P("");else{const ge=ue.lastIndexOf(":"),we=ue.slice(0,ge),Le=parseInt(ue.slice(ge+1));z(qe=>qe.map(at=>at.id===we?{...at,transitions:at.transitions.filter((qt,Bt)=>Bt!==Le)}:at))}G(null)},[]),De=_.useCallback((ue,ge)=>{if(ue==="start")O(ge);else{const we=ue.lastIndexOf(":"),Le=ue.slice(0,we),qe=parseInt(ue.slice(we+1));z(at=>at.map(qt=>qt.id===Le?{...qt,transitions:qt.transitions.map((Bt,Vt)=>Vt===qe?{...Bt,when:ge}:Bt)}:qt))}},[]),Xe=ue=>hm(ue,le).name,Qe=()=>{if(!L)return null;if(L==="start"){const Bt=A.find(Vt=>Vt.id===B);return{type:"start",fromLabel:"Start",toLabel:Bt?Xe(Bt):"(none)",condition:W}}const ue=L.lastIndexOf(":"),ge=L.slice(0,ue),we=parseInt(L.slice(ue+1)),Le=A.find(Bt=>Bt.id===ge);if(!Le)return null;const qe=Le.transitions[we];if(!qe)return null;const at=A.find(Bt=>Bt.id===qe.goto),qt=qe.goto==="$done"?"Done":at?Xe(at):qe.goto;return{type:"step",fromLabel:Xe(Le),toLabel:qt,condition:qe.when}};if(y==="edit"){const ue=Qe();return u.jsxs(In,{isOpen:e,onClose:()=>v("list"),title:w?"Edit Workflow":"New Workflow",size:"full",children:[$&&u.jsx("div",{className:"text-accent-error text-sm px-3 py-2 bg-accent-error/10 rounded mb-3",children:$}),u.jsxs("div",{className:"flex items-end gap-3 mb-3 pb-3 border-b border-border flex-wrap",children:[u.jsxs("div",{className:"min-w-[140px]",children:[u.jsx("label",{className:hn,children:"Name"}),u.jsx("input",{value:I,onChange:ge=>vt(ge.target.value),placeholder:"Workflow name",className:Xr})]}),u.jsxs("div",{className:"min-w-[100px]",children:[u.jsx("label",{className:hn,children:"ID"}),u.jsx("input",{value:X,onChange:ge=>!w&&U(ge.target.value),readOnly:!!w,className:`${Xr} font-mono ${w?"opacity-50":""}`})]}),u.jsxs("div",{className:"flex-1 min-w-[140px]",children:[u.jsx("label",{className:hn,children:"Description"}),u.jsx("input",{value:D,onChange:ge=>Q(ge.target.value),placeholder:"What does this workflow do?",className:Xr})]}),u.jsxs("div",{className:"w-20",children:[u.jsx("label",{className:hn,children:"Max Iter."}),u.jsx("input",{type:"number",value:oe,onChange:ge=>ae(Number(ge.target.value)),className:`${Xr} font-mono`})]}),u.jsxs("div",{children:[u.jsx("label",{className:hn,children:"Color"}),u.jsx("input",{type:"color",value:H,onChange:ge=>q(ge.target.value),className:"w-8 h-8 rounded border border-border cursor-pointer bg-transparent"})]})]}),u.jsxs("div",{className:"flex gap-3",style:{height:"calc(90vh - 220px)",minHeight:300},children:[u.jsxs("div",{className:"flex-1 min-w-0 bg-bg-primary/50 border border-border rounded-lg flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border/50 shrink-0",children:[u.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider font-medium",children:"Flow"}),u.jsx("button",{onClick:ce,className:"text-[11px] text-accent-primary hover:text-accent-primary/80",children:"+ Add Step"})]}),u.jsxs("div",{className:"flex-1 min-h-0 p-2 overflow-auto",children:[u.jsx(Rk,{steps:A,entryStep:B,selectedNodeId:(At==null?void 0:At.id)??null,selectedEdgeKey:L,startConditionLabel:kn,agentTypes:le,onSelectNode:ge=>{if(ge===null){Tt(null);return}const we=A.findIndex(Le=>Le.id===ge);Tt(we>=0?String(we):null)},onSelectEdge:Gt,onRemoveStep:ge=>{var Le;const we=A.findIndex(qe=>qe.id===ge);if(z(qe=>qe.filter(at=>at.id!==ge)),en===we&&Tt(null),B===ge){const qe=A.filter(at=>at.id!==ge);P(((Le=qe[0])==null?void 0:Le.id)??"")}},onCreateTransition:ve,onReconnectTo:Me,onReconnectFrom:K,onDeleteTransition:Se}),A.length===0&&u.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-text-muted",children:[u.jsx("p",{className:"text-xs mb-2",children:"No steps yet"}),u.jsx("button",{onClick:ce,className:"px-3 py-1.5 rounded bg-accent-primary/10 text-accent-primary text-xs hover:bg-accent-primary/20",children:"+ Add your first step"})]})]})]}),u.jsxs("div",{className:"w-[300px] shrink-0 border border-border rounded-lg bg-bg-secondary flex flex-col overflow-hidden",children:[u.jsx("div",{className:"px-3 py-1.5 border-b border-border shrink-0",children:u.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider font-medium",children:"Properties"})}),u.jsx("div",{className:"p-3 overflow-y-auto flex-1 min-h-0",children:ue?ue.type==="start"?u.jsxs("div",{className:"space-y-3 text-sm",children:[u.jsx("div",{className:"flex items-center gap-2",children:u.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-semibold bg-blue-500/20 text-blue-300",children:"Start"})}),B&&u.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-text-secondary",children:[u.jsx("span",{className:"text-text-primary font-medium",children:"Start"}),u.jsx("svg",{className:"w-3.5 h-3.5 shrink-0 text-text-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})}),u.jsx("span",{className:"text-text-primary font-medium",children:ue.toLabel})]}),u.jsxs("div",{children:[u.jsx("label",{className:hn,children:"Activation Condition"}),u.jsx("select",{value:W.type,onChange:ge=>O(ge.target.value==="step_result"?{type:"step_result",result:"success"}:{type:ge.target.value}),className:ri,children:z0.map(ge=>u.jsx("option",{value:ge.value,children:ge.label},ge.value))})]}),W.type==="step_result"&&u.jsxs("div",{children:[u.jsx("label",{className:hn,children:"Result"}),u.jsxs("select",{value:W.result??"success",onChange:ge=>O({type:"step_result",result:ge.target.value}),className:ri,children:[u.jsx("option",{value:"success",children:"success"}),u.jsx("option",{value:"failure",children:"failure"})]})]}),u.jsx("p",{className:"text-text-muted text-[10px]",children:"Workflow only proceeds when this condition is met. Drag the target handle to change entry step."})]}):u.jsx(Mk,{fromLabel:ue.fromLabel,toLabel:ue.toLabel,condition:ue.condition,onUpdateCondition:ge=>De(L,ge),onDelete:()=>Se(L)}):At?u.jsx(zk,{step:At,isEntry:At.id===B,agentTypes:le,transitionCount:At.transitions.length,onUpdate:Ot,onRemove:()=>{var ge;if(At&&(z(A.filter((we,Le)=>Le!==en)),Tt(null),B===At.id)){const we=A.filter((Le,qe)=>qe!==en);P(((ge=we[0])==null?void 0:ge.id)??"")}},onSetEntry:()=>P(At.id)}):u.jsxs("p",{className:"text-text-muted text-xs text-center py-8",children:["Click a node or edge to edit.",u.jsx("br",{}),"Drag from a port to connect."]})})]})]}),u.jsxs("div",{className:"flex justify-end gap-2 pt-3 mt-3 border-t border-border",children:[u.jsx(gt,{variant:"secondary",onClick:()=>v("list"),children:"Cancel"}),u.jsx(gt,{variant:"secondary",onClick:Je,disabled:re||!I,children:re?"Saving...":"Save"}),u.jsx(gt,{variant:"primary",onClick:Ge,disabled:re||!I,children:"Save & Close"})]})]})}return u.jsxs(In,{isOpen:e,onClose:n,title:"Workflows",size:"md",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("p",{className:"text-text-secondary text-sm",children:"Workflows define the orchestrator's step sequence when running tasks."}),u.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 ml-3",children:[i.length>0&&(He?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:async()=>{await b(),fe(!1)},className:"px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400 text-xs hover:bg-amber-500/30 transition-colors",children:"Confirm"}),u.jsx("button",{onClick:()=>fe(!1),className:"px-1.5 py-0.5 rounded text-text-muted text-xs hover:bg-bg-primary transition-colors",children:"Cancel"})]}):u.jsx("button",{onClick:()=>fe(!0),className:"px-2 py-1 rounded text-xs text-text-muted hover:text-amber-400 hover:bg-amber-500/10 transition-colors",title:"Restore all workflows to defaults",children:"Restore Defaults"})),u.jsx(gt,{variant:"primary",size:"sm",onClick:Ce,children:"+ New"})]})]}),s&&l.length===0?u.jsx("div",{className:"text-text-muted text-sm",children:"Loading workflows..."}):l.length===0?u.jsx("div",{className:"text-text-muted text-sm",children:"No workflows installed."}):u.jsx("div",{className:"space-y-2",children:l.map(ue=>u.jsxs("div",{className:"flex items-center justify-between p-3 rounded border border-border bg-bg-tertiary",children:[u.jsxs("div",{className:"min-w-0 flex-1 mr-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-text-primary text-sm font-medium",children:ue.name}),u.jsxs("span",{className:"text-text-muted text-xs",children:["v",ue.version]}),i.includes(ue.id)&&u.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-amber-500/15 text-amber-400",children:"modified"})]}),u.jsx("p",{className:"text-text-secondary text-xs mt-0.5 truncate",children:ue.description})]}),u.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[i.includes(ue.id)&&(Te===ue.id?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:async()=>{await x(ue.id),je(null)},className:"px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400 text-xs hover:bg-amber-500/30 transition-colors",children:"Restore"}),u.jsx("button",{onClick:()=>je(null),className:"px-1.5 py-0.5 rounded text-text-muted text-xs hover:bg-bg-primary transition-colors",children:"Cancel"})]}):u.jsx("button",{onClick:()=>je(ue.id),className:"p-1.5 rounded hover:bg-bg-primary text-text-muted hover:text-amber-400 transition-colors",title:"Restore default",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})),u.jsx("button",{onClick:()=>Re(ue.id),className:"p-1.5 rounded hover:bg-bg-primary text-text-muted hover:text-text-primary transition-colors",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),ue.id!=="default"&&(j===ue.id?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:()=>{m(ue.id),k(null)},className:"px-1.5 py-0.5 rounded bg-accent-error/20 text-accent-error text-xs",children:"Delete"}),u.jsx("button",{onClick:()=>k(null),className:"px-1.5 py-0.5 rounded text-text-muted text-xs",children:"Cancel"})]}):u.jsx("button",{onClick:()=>k(ue.id),className:"p-1.5 rounded hover:bg-bg-primary text-text-muted hover:text-accent-error transition-colors",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})}))]})]},ue.id))})]})}function Ds({items:e,trigger:n,minWidth:l="120px"}){const[i,s]=_.useState(!1),c=_.useRef(null);return _.useEffect(()=>{function d(f){c.current&&!c.current.contains(f.target)&&s(!1)}return i&&document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[i]),u.jsxs("div",{className:"relative",ref:c,children:[u.jsx("div",{onClick:()=>s(!i),children:n}),i&&u.jsx("div",{className:"absolute left-0 top-full mt-1 bg-bg-secondary border border-border rounded shadow-lg z-50",style:{minWidth:l},children:e.map((d,f)=>u.jsxs("button",{onClick:p=>{d.onClick(p),s(!1)},className:`w-full px-3 py-2 text-left text-sm hover:bg-bg-tertiary transition-colors flex items-center gap-2 ${d.danger?"text-accent-error hover:bg-accent-error/10":"text-text-primary"} ${f!==e.length-1?"border-b border-border":""}`,children:[d.icon&&u.jsx("span",{className:"w-4 h-4 flex-shrink-0",children:d.icon}),d.label]},f))})]})}function D0(e){const n=new Date(e),i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][n.getDay()],s=n.getFullYear(),c=String(n.getMonth()+1).padStart(2,"0"),d=String(n.getDate()).padStart(2,"0");return`${i} ${s}/${c}/${d}`}function L0(e){const n=new Date(e),l=String(n.getHours()).padStart(2,"0"),i=String(n.getMinutes()).padStart(2,"0");return`${l}:${i}`}function Lk(e){const n=new Date(e),l=n.getFullYear(),i=String(n.getMonth()+1).padStart(2,"0"),s=String(n.getDate()).padStart(2,"0");return`${l}-${i}-${s}`}function I0(e){const n=new Map;for(const s of e){const c=Lk(s.updatedAt);n.has(c)||n.set(c,[]),n.get(c).push(s)}for(const[s,c]of n)c.sort((d,f)=>{const p=new Date(d.updatedAt).getTime();return new Date(f.updatedAt).getTime()-p});const l=Array.from(n.keys()).sort((s,c)=>c.localeCompare(s)),i=new Map;for(const s of l)i.set(s,n.get(s));return i}function Ik({projects:e,currentProject:n}){const[,l]=Zr(),i=Jt(d=>d.loadProject),c=[...e].sort((d,f)=>d.name.localeCompare(f.name)).map(d=>({label:d.name,icon:d.id===n.id?u.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):void 0,onClick:()=>{i(d.id),l(`/p/${d.id}`)}}));return u.jsx(Ds,{items:c,trigger:u.jsxs("button",{className:"text-text-secondary hover:text-text-primary hover:underline text-sm truncate flex items-center gap-1",title:n.name,children:[n.name,u.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),minWidth:"250px"})}function Bk({sessions:e,currentProject:n,currentSession:l}){var N;const[,i]=Zr(),s=Ae(j=>j.loadSession),c=Ae(j=>j.createSession),d=Ae(j=>j.pendingSessionCreate),f=Ae(j=>j.resetPendingSessionCreate),p=Ae(j=>j.sessions),[m,x]=_.useState(l==null?void 0:l.id);_.useEffect(()=>{if(d&&n){const j=p.find(k=>k.projectId===n.id);j&&j.id!==m&&(i(`/p/${n.id}/s/${j.id}`),x(j.id),f())}},[d,p,n,m,i,f]);const b=e.filter(j=>j.projectId===n.id).slice(0,15),y=I0(b),v=[];v.push({label:u.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 min-w-[160px]",children:[u.jsx("svg",{className:"w-4 h-4 text-accent-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),u.jsx("span",{className:"text-sm",children:"New session"})]}),onClick:()=>{c(n.id)}});for(const[j,k]of y){const T=k[0];if(T){v.push({label:u.jsx("div",{className:"px-3 py-2 text-text-muted text-xs font-medium cursor-default",children:D0(T.updatedAt)}),onClick:()=>{}});for(const C of k)v.push({label:u.jsxs("div",{className:"min-w-[160px]",children:[u.jsx("div",{className:"truncate text-sm",children:C.title??C.id.slice(0,8)}),u.jsx("div",{className:"text-text-muted text-xs",children:L0(C.updatedAt)})]}),icon:C.id===(l==null?void 0:l.id)?u.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):void 0,onClick:()=>{s(C.id),i(`/p/${n.id}/s/${C.id}`)}})}}const w=l?((N=l.metadata)==null?void 0:N.title)??l.id.slice(0,8):"No session selected";return u.jsx(Ds,{items:v,trigger:u.jsxs("button",{className:"text-text-secondary hover:text-text-primary hover:underline text-sm truncate flex items-center gap-1",title:w,children:[w,u.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),minWidth:"280px"})}function Hk({onMenuClick:e,onCriteriaToggle:n,hasCriteria:l}){const[i,s]=_.useState(!1),[c,d]=_.useState(!1),[f,p]=_.useState(!1),[m,x]=_.useState(!1),b=Ae(T=>T.connectionStatus),y=Ae(T=>T.currentSession),v=Ae(T=>T.sessions),w=Jt(T=>T.currentProject),N=Jt(T=>T.projects),j=Nn(T=>T.startAutoRefresh),k=Nn(T=>T.stopAutoRefresh);return _.useEffect(()=>(j(),()=>k()),[j,k]),u.jsxs("header",{className:"h-8 bg-bg-secondary border-b border-border flex items-center justify-between px-2",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e&&u.jsx("button",{onClick:e,className:"xl:hidden flex-shrink-0 p-2.5 rounded hover:bg-bg-tertiary text-text-muted hover:text-text-primary transition-colors",title:"Toggle sidebar",children:u.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),u.jsx(Uw,{href:"/",className:"text-accent-primary font-semibold text-base hover:underline flex-shrink-0",children:"OpenFox"}),w&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-text-muted flex-shrink-0",children:"/"}),u.jsx(Ik,{projects:N,currentProject:w})]}),w&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-text-muted flex-shrink-0",children:"/"}),u.jsx(Bk,{sessions:v,currentProject:w,currentSession:y})]})]}),u.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[n&&l&&u.jsx("button",{onClick:n,className:"p-2.5 rounded hover:bg-bg-tertiary text-text-muted hover:text-text-primary transition-colors",title:"Toggle criteria sidebar",children:u.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})})}),u.jsx(Ds,{items:[{label:"Settings",icon:u.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),onClick:()=>s(!0)},{label:"Skills",icon:u.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),onClick:()=>d(!0)},{label:"Agents",icon:u.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})}),onClick:()=>p(!0)},{label:"Workflows",icon:u.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 10h16M4 14h16M4 18h16"})}),onClick:()=>x(!0)}],trigger:u.jsx("button",{className:"p-2.5 rounded hover:bg-bg-tertiary text-text-muted hover:text-text-primary transition-colors",title:"Menu",children:u.jsxs("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:[u.jsx("circle",{cx:"12",cy:"5",r:"2"}),u.jsx("circle",{cx:"12",cy:"12",r:"2"}),u.jsx("circle",{cx:"12",cy:"19",r:"2"})]})})}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("div",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${b==="connected"?"bg-accent-success":b==="reconnecting"?"bg-accent-warning animate-pulse":"bg-accent-error"}`}),u.jsx("span",{className:"text-sm text-text-secondary hidden sm:inline",children:b==="connected"?"Connected":b==="reconnecting"?"Reconnecting...":"Disconnected"})]})]}),u.jsx(vk,{isOpen:i,onClose:()=>s(!1)}),u.jsx(kk,{isOpen:c,onClose:()=>d(!1)}),u.jsx(Ek,{isOpen:f,onClose:()=>p(!1)}),u.jsx(Dk,{isOpen:m,onClose:()=>x(!1)})]})}function Uk({isOpen:e,onClose:n,title:l,label:i,description:s,placeholder:c,value:d,isLoading:f=!1,onSave:p}){const[m,x]=_.useState(d),[b,y]=_.useState(!1),[v,w]=_.useState(!1);_.useEffect(()=>{x(d),y(!1)},[d]);const N=C=>{x(C.target.value),y(!0)},j=async()=>{w(!0),await p(m),w(!1),y(!1),n()},k=()=>{x(d),y(!1),n()},T=f||v;return u.jsx(In,{isOpen:e,onClose:k,title:l,size:"lg",children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-text-primary mb-2",children:i}),u.jsx("p",{className:"text-sm text-text-muted mb-2",children:s}),u.jsx("textarea",{value:m,onChange:N,placeholder:c,className:"w-full h-64 px-3 py-2 bg-bg-tertiary border border-border rounded text-sm font-mono resize-none focus:outline-none focus:ring-1 focus:ring-accent-primary",disabled:T})]}),u.jsxs("div",{className:"flex justify-end gap-2 pt-2 border-t border-border",children:[u.jsx(gt,{variant:"secondary",onClick:k,children:"Cancel"}),u.jsx(gt,{variant:"primary",onClick:j,disabled:!b||T,children:v?"Saving...":"Save"})]})]})})}function Fk({isOpen:e,onClose:n,project:l}){const i=Jt(c=>c.updateProject),s=async c=>{i(l.id,{customInstructions:c||null}),await new Promise(d=>setTimeout(d,100))};return u.jsx(Uk,{isOpen:e,onClose:n,title:`${l.name} Settings`,label:"Project Instructions",description:"These instructions are injected into prompts when working in this project. They are applied after global instructions but before AGENTS.md files.",placeholder:"Enter project-specific instructions...",value:l.customInstructions??"",onSave:s})}function B0({projectId:e,isOpen:n=!0,onClose:l}){const[,i]=Zr(),s=_.useRef(!1),[c,d]=_.useState(!1),f=Ae(L=>L.sessions),p=Ae(L=>L.currentSession),m=Ae(L=>L.unreadSessionIds),x=Ae(L=>L.createSession),b=Ae(L=>L.deleteSession),y=Ae(L=>L.deleteAllSessions),v=Ae(L=>L.listSessions),w=Jt(L=>L.currentProject),N=f.filter(L=>L.projectId===(w==null?void 0:w.id));_.useEffect(()=>{s.current&&p&&(s.current=!1,v(),i(`/p/${e}/s/${p.id}`))},[p,e,i,v]);const j=()=>{s.current=!0,x(e)},k=L=>{i(`/p/${e}/s/${L}`),l&&l()},T=(L,G)=>{G==null||G.stopPropagation(),confirm("Delete this session?")&&(b(L),(p==null?void 0:p.id)===L&&i(`/p/${e}`))},C=()=>{confirm("Delete all sessions in this project? This cannot be undone.")&&(y(e),i(`/p/${e}`))};return u.jsxs(u.Fragment,{children:[n&&l&&u.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:l}),u.jsxs("aside",{className:`
58
-
59
- xl:relative xl:z-auto xl:translate-x-0 xl:h-auto
60
-
61
- fixed z-50 -translate-x-full h-[calc(100vh-32px)]
62
-
63
- w-[300px] bg-bg-secondary border-r border-border flex flex-col
64
- transition-transform duration-300 ease-in-out
65
- ${n?"translate-x-0":""}
66
- `,children:[u.jsxs("div",{className:"p-4 border-b border-border flex gap-2",children:[u.jsx(gt,{variant:"primary",className:"flex-1 text-sm",onClick:j,children:"+ New Session"}),u.jsx(Ds,{items:[{label:"Edit project settings",onClick:()=>d(!0)},{label:"Delete all sessions",onClick:C,danger:!0}],trigger:u.jsx("button",{className:"flex-shrink-0 p-2.5 rounded hover:bg-bg-tertiary text-text-muted hover:text-text-primary transition-colors",title:"Options",children:u.jsxs("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:[u.jsx("circle",{cx:"12",cy:"5",r:"2"}),u.jsx("circle",{cx:"12",cy:"12",r:"2"}),u.jsx("circle",{cx:"12",cy:"19",r:"2"})]})})}),l&&u.jsx("button",{onClick:l,className:"md:hidden flex-shrink-0 p-2.5 rounded hover:bg-bg-tertiary text-text-muted hover:text-text-primary transition-colors",title:"Close sidebar",children:u.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),w&&u.jsx(Fk,{isOpen:c,onClose:()=>d(!1),project:w}),u.jsx("div",{className:"flex-1 overflow-y-auto",children:N.length===0?u.jsx("div",{className:"p-4 text-center text-text-muted text-xs",children:"No sessions"}):u.jsx("div",{className:"divide-y divide-border",children:$k(N,p,m,k,T)})})]})]})}function $k(e,n,l,i,s){const c=I0(e);return Array.from(c).map(([d,f])=>{const p=f[0];return p?u.jsxs("div",{children:[u.jsx("div",{className:"px-4 py-2 bg-bg-tertiary/30 text-text-muted text-xs font-medium",children:D0(p.updatedAt)}),f.map(m=>{const x=(n==null?void 0:n.id)===m.id,b=l.includes(m.id),y=m.isRunning;return u.jsxs("div",{onClick:()=>i(m.id),className:`w-full px-4 py-3 text-left hover:bg-bg-tertiary/50 transition-colors group cursor-pointer ${x?"bg-bg-tertiary":""}`,children:[u.jsxs("div",{className:"flex justify-between items-center mb-1",children:[u.jsx("span",{className:`font-medium truncate text-sm ${x?"text-accent-primary":"text-text-primary"}`,children:m.title??m.id.slice(0,6)}),u.jsx(Ds,{items:[{label:"Delete session",onClick:v=>s(m.id,v),danger:!0}],trigger:u.jsx("button",{className:"p-1.5 rounded hover:bg-bg-tertiary text-text-muted hover:text-text-primary transition-all",title:"Options",children:u.jsxs("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:[u.jsx("circle",{cx:"12",cy:"5",r:"2"}),u.jsx("circle",{cx:"12",cy:"12",r:"2"}),u.jsx("circle",{cx:"12",cy:"19",r:"2"})]})})})]}),u.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[y?u.jsxs("svg",{"aria-label":"Session running",className:"w-3 h-3 text-blue-400 animate-spin flex-shrink-0",viewBox:"0 0 24 24",fill:"none",children:[u.jsx("title",{children:"Running"}),u.jsx("circle",{className:"opacity-30",cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"3"}),u.jsx("path",{d:"M21 12a9 9 0 00-9-9",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}):b&&!x?u.jsx("span",{"aria-label":"Unread activity",title:"Unread activity",className:"w-2 h-2 rounded-full bg-amber-400 flex-shrink-0"}):null,u.jsx("span",{className:"text-text-muted text-xs flex-shrink-0",children:L0(m.updatedAt)})]})]},m.id)})]},d):null})}function Gk(){const e=Jt(i=>i.currentProject),n=Ae(i=>i.currentSession);return _.useEffect(()=>{var c;const s=(c=n==null?void 0:n.metadata)==null?void 0:c.title;e&&s?document.title=`${e.name} - ${s} | OpenFox`:e?document.title=`${e.name} | OpenFox`:document.title="OpenFox"},[e,n,!1]),null}const gm=_.forwardRef(({className:e="",...n},l)=>u.jsx("input",{ref:l,className:`bg-bg-tertiary border border-border rounded px-3 py-2 text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent-primary/50 focus:border-accent-primary ${e}`,...n}));gm.displayName="Input";function H0({isOpen:e,onClose:n,projectName:l,onConfirm:i}){const s=()=>{i(),n()};return u.jsx(In,{isOpen:e,onClose:n,title:"Delete Project",size:"sm",children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-text-secondary",children:["This will permanently delete the project ",u.jsx("span",{className:"font-semibold text-text-primary",children:l})," and all its sessions from OpenFox. The project files on disk will remain untouched."]}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(gt,{variant:"secondary",onClick:n,children:"Cancel"}),u.jsx(gt,{variant:"danger",onClick:s,children:"Delete"})]})]})})}function qk(e){return!e||e.trim()===""?{valid:!1,error:"Project name cannot be empty"}:/^[a-zA-Z0-9._-]+$/.test(e)?{valid:!0}:{valid:!1,error:"Project name can only contain letters, numbers, hyphens, underscores, and dots"}}function U0({isOpen:e,onClose:n}){const[,l]=Zr(),[i,s]=_.useState(""),[c,d]=_.useState(null),[f,p]=_.useState(!1),[m,x]=_.useState(""),b=_.useRef(null),y=_.useRef(null),v=_.useRef(null),w=_.useRef(null),N=_.useRef(null);_.useEffect(()=>{e&&(fetch("/api/config").then(C=>C.json()).then(C=>{C.workdir&&x(C.workdir)}),s(""),d(null),p(!1),setTimeout(()=>{var C;(C=b.current)==null||C.focus()},100))},[e]);const j=_.useCallback(async C=>{C.preventDefault();const L=qk(i);if(!L.valid){d(L.error);return}p(!0),d(null),N.current&&(N.current(),N.current=null);try{const G=M=>{var H,q,B;if(typeof M!="object"||M===null||!("id"in M))return;const V=M;if(V.id===w.current){if(V.type==="error")(H=v.current)==null||H.call(v,new Error(V.message||"Unknown error"));else if(V.type==="project.state"){const P=V.payload;P!=null&&P.project?(q=y.current)==null||q.call(y,P.project):(B=v.current)==null||B.call(v,new Error("Invalid project state response"))}}};N.current=ot.subscribe(G);const I=new Promise((M,V)=>{y.current=M,v.current=V,setTimeout(()=>{V(new Error("Request timeout"))},3e4)}),R=ot.send("project.create-with-dir",{name:i});w.current=R;const X=await I;N.current&&(N.current(),N.current=null);const U=ot.send("project.list",{});await new Promise((M,V)=>{let H=!1;const q=P=>{if(H||typeof P!="object"||P===null||!("id"in P))return;const oe=P;oe.id===U&&(oe.type==="project.list"?(H=!0,M()):oe.type==="error"&&(H=!0,V(new Error(oe.message||"Failed to refresh project list"))))},B=ot.subscribe(q);setTimeout(()=>{H||(B(),V(new Error("Timeout waiting for project list")))},1e4)});const Q=X;n(),l(`/p/${Q.id}`)}catch(G){d(G instanceof Error?G.message:"Failed to create project"),p(!1)}},[i,l,n]),k=_.useCallback(()=>{s(""),d(null),n()},[n]),T=i?`${m}/${i}`:"";return u.jsx(In,{isOpen:e,onClose:k,title:"Create New Project",size:"sm",children:u.jsxs("form",{onSubmit:j,className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{htmlFor:"project-name",className:"block text-sm font-medium text-text-secondary mb-2",children:"Project Name"}),u.jsx(gm,{ref:b,id:"project-name",value:i,onChange:C=>{s(C.target.value),d(null)},placeholder:"my-project",disabled:f,className:"w-full"}),i&&u.jsxs("div",{className:"mt-2 text-xs text-text-muted",children:["Full path: ",u.jsx("span",{className:"font-mono",children:T})]}),c&&u.jsx("div",{className:"mt-3 p-3 bg-accent-error/10 border border-accent-error/30 rounded text-sm text-accent-error",children:c})]}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(gt,{type:"button",variant:"secondary",onClick:k,disabled:f,children:"Cancel"}),u.jsx(gt,{type:"submit",variant:"primary",disabled:f||!i.trim(),className:"min-w-[100px]",children:f?u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsxs("svg",{className:"animate-spin h-4 w-4",fill:"none",viewBox:"0 0 24 24",children:[u.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),u.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Creating..."]}):"Create"})]})]})})}function Vk({isOpen:e,onClose:n}){const[,l]=Zr(),[i,s]=_.useState(!1),[c,d]=_.useState(""),[f,p]=_.useState(null),[m,x]=_.useState(!1),[b,y]=_.useState(null),v=Jt(ae=>ae.projects),w=Jt(ae=>ae.createProject),N=Jt(ae=>ae.listProjects),j=Jt(ae=>ae.deleteProject),[k,T]=_.useState(null),[C,L]=_.useState(-1),[G,I]=_.useState(null),R=_.useRef([]);_.useEffect(()=>{fetch("/api/config").then(ae=>ae.json()).then(ae=>{ae.workdir&&y(ae.workdir)})},[]);const X=_.useCallback(async ae=>{x(!0);try{const A=ae?`/api/directories?path=${encodeURIComponent(ae)}`:b?`/api/directories?path=${encodeURIComponent(b)}`:"/api/directories",W=await(await fetch(A)).json();p(W)}catch(A){console.error("Failed to load directories:",A)}finally{x(!1)}},[b]);_.useEffect(()=>{e&&b&&(X(b),N())},[e,b,X,N]);const U=(f==null?void 0:f.directories.filter(ae=>c===""||ae.name.toLowerCase().includes(c.toLowerCase())))??[],D=[...f!=null&&f.parent&&!c?[{type:"parent",path:f.parent,name:".."}]:[],...U.map(ae=>({type:"directory",path:ae.path,name:ae.name}))],Q=ae=>{l(`/p/${ae}`),n()},M=(ae,A)=>{A.stopPropagation(),I(ae)},V=()=>{G&&(j(G.id),I(null))},H=ae=>{const A=ae.split("/").filter(Boolean).pop()??"";w(A,ae),N(),T(ae)};_.useEffect(()=>{if(k){const ae=v.find(A=>A.workdir===k);ae&&(l(`/p/${ae.id}`),n(),T(null))}},[v,k,l,n]),_.useEffect(()=>{L(D.length>0?0:-1)},[c,D.length]);const q=ae=>{d(""),X(ae)},B=_.useCallback(ae=>{if(!e)return;if(ae.key==="Escape"){n();return}if(!["ArrowDown","ArrowUp","Enter"].includes(ae.key))return;const A=document.activeElement;if(!(!A||A.tagName!=="INPUT")){if(ae.preventDefault(),ae.key==="ArrowDown")L(z=>{const W=z+1;return W>=D.length?0:W});else if(ae.key==="ArrowUp")L(z=>{const W=z-1;return W<0?D.length-1:W});else if(ae.key==="Enter"&&C>=0&&C<D.length){const z=D[C];(z==null?void 0:z.type)==="parent"?q(z.path):z&&H(z.path)}}},[e,D.length,C,q,H,n]);_.useEffect(()=>{if(e)return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[e,B]),_.useEffect(()=>{C>=0&&R.current[C]&&R.current[C].scrollIntoView({behavior:"smooth",block:"nearest"})},[C]);const oe=(()=>{if(!f)return[];const ae=f.current.split("/").filter(Boolean),A=[];let z="";for(const W of ae)z+="/"+W,A.push({name:W,path:z});return A})();return e?u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50",children:[u.jsxs("div",{className:"bg-bg-secondary border border-border rounded-lg w-full max-w-[90vw] md:max-w-4xl max-h-[90vh] flex flex-col",children:[u.jsxs("div",{className:"p-4 border-b border-border flex items-center justify-between",children:[u.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Open Project"}),u.jsx("button",{onClick:n,className:"p-1 rounded hover:bg-bg-tertiary text-text-muted hover:text-text-primary transition-colors",children:u.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),u.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-[400px]",children:[u.jsxs("div",{className:"w-1/2 border-r border-border flex flex-col",children:[u.jsx("div",{className:"p-3 border-b border-border bg-bg-tertiary/30",children:u.jsx("h3",{className:"font-medium text-sm text-text-secondary",children:"Recent Projects"})}),u.jsx("div",{className:"flex-1 overflow-y-auto",children:v.length===0?u.jsx("div",{className:"p-4 text-center text-text-muted text-sm",children:"No recent projects"}):u.jsx("div",{className:"divide-y divide-border",children:v.map(ae=>u.jsxs("div",{className:"group flex items-center gap-3 p-3 hover:bg-bg-tertiary/50 transition-colors",children:[u.jsxs("button",{onClick:()=>Q(ae.id),className:"flex-1 flex items-center gap-3 text-left",children:[u.jsx("svg",{className:"w-5 h-5 text-accent-primary",fill:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{d:"M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"font-medium truncate",children:ae.name}),u.jsx("div",{className:"text-xs text-text-muted truncate",children:ae.workdir})]})]}),u.jsx("button",{onClick:A=>M(ae,A),className:"opacity-0 group-hover:opacity-100 text-accent-error/70 hover:text-accent-error p-1 transition-opacity",title:"Delete project",children:u.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},ae.id))})})]}),u.jsxs("div",{className:"w-1/2 flex flex-col",children:[u.jsx("div",{className:"p-3 border-b border-border bg-bg-tertiary/30",children:u.jsx("h3",{className:"font-medium text-sm text-text-secondary",children:"Browse Projects"})}),u.jsx("div",{className:"p-3 border-b border-border",children:u.jsxs("div",{className:"relative",children:[u.jsx(gm,{value:c,onChange:ae=>d(ae.target.value),placeholder:"Type to filter directories...",className:"w-full pl-9"}),u.jsx("svg",{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-text-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]})}),u.jsx("div",{className:"px-3 py-2 bg-bg-tertiary/30 border-b border-border",children:u.jsx("div",{className:"flex items-center text-xs overflow-x-auto",children:oe.map((ae,A)=>u.jsxs("span",{className:"flex items-center flex-shrink-0",children:[u.jsx("span",{className:"text-text-muted",children:"/"}),A===oe.length-1?u.jsx("span",{className:"text-accent-primary font-medium px-1",children:ae.name}):u.jsx("button",{onClick:()=>q(ae.path),className:"text-text-secondary hover:text-accent-primary px-1",children:ae.name})]},ae.path))})}),u.jsx("div",{className:"flex-1 overflow-y-auto",children:m?u.jsx("div",{className:"p-8 text-center text-text-muted",children:u.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-accent-primary border-t-transparent rounded-full mx-auto"})}):D.length===0?u.jsx("div",{className:"p-8 text-center text-text-muted text-sm",children:c?"No matching directories":"No subdirectories"}):u.jsx("div",{className:"divide-y divide-border",children:D.map((ae,A)=>u.jsxs("button",{ref:z=>{R.current[A]=z},onClick:()=>ae.type==="parent"?q(ae.path):H(ae.path),className:`w-full p-3 flex items-center gap-3 text-left transition-colors ${A===C?"bg-accent-primary/20 text-accent-primary":"hover:bg-bg-tertiary/50"}`,children:[u.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{d:"M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"})}),u.jsx("span",{className:"flex-1",children:ae.name})]},ae.path))})})]})]}),u.jsxs("div",{className:"p-4 border-t border-border flex justify-between gap-2",children:[u.jsx(gt,{variant:"secondary",onClick:()=>s(!0),children:"Create Project"}),u.jsx(gt,{variant:"secondary",onClick:n,children:"Cancel"})]})]}),i&&u.jsx(U0,{isOpen:i,onClose:()=>s(!1)}),G&&u.jsx(H0,{isOpen:!0,onClose:()=>I(null),projectName:G.name,onConfirm:V})]}):null}function Yk(){const[,e]=Zr(),[n,l]=_.useState(!1),[i,s]=_.useState(!1),[c,d]=_.useState(null),f=Ae(L=>L.sessions),p=Jt(L=>L.projects),m=Jt(L=>L.listProjects),x=Ae(L=>L.listSessions),b=Jt(L=>L.deleteProject);_.useEffect(()=>{m(),x()},[m,x]);const y=f.slice(0,5),v=p.slice(0,5),w=L=>{const G=f.find(I=>I.id===L);if(G){const I=p.find(R=>G.workdir.startsWith(R.workdir));I&&e(`/p/${I.id}/s/${L}`)}},N=L=>{e(`/p/${L}`)},j=()=>{l(!0)},k=(L,G)=>{G.stopPropagation(),d(L)},T=()=>{c&&(b(c.id),d(null))},C=L=>{switch(L){case"done":return"bg-green-500/20 text-green-400";case"blocked":return"bg-red-500/20 text-red-400";case"verification":return"bg-yellow-500/20 text-yellow-400";case"build":return"bg-blue-500/20 text-blue-400";case"plan":default:return"bg-purple-500/20 text-purple-400"}};return u.jsxs("div",{className:"flex-1 flex flex-col overflow-y-auto",children:[u.jsxs("div",{className:"max-w-5xl mx-auto w-full p-4 md:p-8",children:[u.jsxs("div",{className:"mb-6 md:mb-8",children:[u.jsx("h1",{className:"text-3xl font-bold text-accent-primary mb-2",children:"OpenFox"}),u.jsx("p",{className:"text-text-secondary",children:"Local LLM-powered coding assistant with contract-driven execution"})]}),u.jsx("div",{className:"mb-6 md:mb-8",children:u.jsx(gt,{variant:"primary",className:"w-full py-4 text-lg font-semibold",onClick:j,children:"Open Project"})}),y.length>0&&u.jsxs("div",{className:"mb-6 md:mb-8",children:[u.jsx("div",{className:"flex items-center justify-between mb-3",children:u.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Recent Sessions"})}),u.jsx("div",{className:"bg-bg-secondary border border-border rounded overflow-hidden",children:u.jsx("div",{className:"divide-y divide-border",children:y.map(L=>{const G=p.find(I=>L.workdir.startsWith(I.workdir));return u.jsx("div",{onClick:()=>w(L.id),className:"p-3 md:p-4 hover:bg-bg-tertiary/50 cursor-pointer transition-colors",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[u.jsx("svg",{className:"w-5 h-5 text-accent-primary flex-shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{d:"M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"font-medium text-text-primary truncate",children:(G==null?void 0:G.name)??"Unknown Project"}),u.jsx("div",{className:"text-sm text-text-muted truncate",children:L.title??L.id.slice(0,8)})]})]}),u.jsxs("span",{className:`text-xs px-2 py-1 rounded flex items-center gap-1 flex-shrink-0 ${C(L.phase)}`,children:[L.phase==="done"?u.jsxs(u.Fragment,{children:[u.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"done"]}):L.phase==="blocked"?u.jsxs(u.Fragment,{children:[u.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),"blocked"]}):L.phase==="verification"?"verify":L.phase,L.isRunning&&L.phase!=="done"&&L.phase!=="blocked"&&" •"]})]})},L.id)})})})]}),v.length>0&&u.jsxs("div",{children:[u.jsx("h2",{className:"text-lg font-semibold text-text-primary mb-3",children:"Quick Projects"}),u.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:v.map(L=>u.jsxs("div",{className:"px-4 py-2 bg-bg-secondary border border-border rounded-full hover:bg-bg-tertiary hover:border-accent-primary transition-colors flex items-center gap-2 group relative",children:[u.jsxs("button",{onClick:()=>N(L.id),className:"flex items-center gap-2",children:[u.jsx("svg",{className:"w-4 h-4 text-accent-primary",fill:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{d:"M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"})}),u.jsx("span",{className:"text-text-primary",children:L.name})]}),u.jsx("button",{onClick:G=>k(L,G),className:"opacity-0 group-hover:opacity-100 text-accent-error/70 hover:text-accent-error p-1 transition-opacity ml-1",title:"Delete project",children:u.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},L.id))})]})]}),n&&u.jsx(Vk,{isOpen:n,onClose:()=>l(!1)}),i&&u.jsx(U0,{isOpen:i,onClose:()=>s(!1)}),c&&u.jsx(H0,{isOpen:!0,onClose:()=>d(null),projectName:c.name,onConfirm:T})]})}function Xk(){const[,e]=Zr(),n=Jt(f=>f.currentProject),l=Ae(f=>f.createSession),i=Ae(f=>f.currentSession),s=Ae(f=>f.pendingSessionCreate),c=Ae(f=>f.resetPendingSessionCreate),d=()=>{n&&l(n.id)};return _.useEffect(()=>{if(s&&n&&i){const f=`/p/${n.id}/s/${i.id}`;e(f),c()}},[s,i,n,e,c]),u.jsx("div",{className:"h-full flex flex-col items-center justify-center p-8 text-center",children:u.jsxs("div",{className:"max-w-md",children:[u.jsx("h2",{className:"text-xl font-semibold text-text-primary mb-2",children:(n==null?void 0:n.name)??"Project"}),u.jsx("p",{className:"text-text-secondary mb-6",children:"No session selected"}),u.jsxs("div",{className:"flex flex-col gap-3",children:[u.jsx(gt,{variant:"primary",className:"w-full",onClick:d,children:"Create New Session"}),u.jsx("p",{className:"text-sm text-text-muted",children:"Or select an existing session from the sidebar"})]})]})})}const Tc=0,Al=1,ua=2,F0=4;function Ib(e){return()=>e}function Pk(e){e()}function $0(e,n){return l=>e(n(l))}function Bb(e,n){return()=>e(n)}function Qk(e,n){return l=>e(n,l)}function xm(e){return e!==void 0}function Zk(...e){return()=>{e.map(Pk)}}function da(){}function Ac(e,n){return n(e),e}function Kk(e,n){return n(e)}function zt(...e){return e}function ht(e,n){return e(Al,n)}function We(e,n){e(Tc,n)}function bm(e){e(ua)}function It(e){return e(F0)}function _e(e,n){return ht(e,Qk(n,Tc))}function hr(e,n){const l=e(Al,i=>{l(),n(i)});return l}function Hb(e){let n,l;return i=>s=>{n=s,l&&clearTimeout(l),l=setTimeout(()=>{i(n)},e)}}function G0(e,n){return e===n}function Mt(e=G0){let n;return l=>i=>{e(n,i)||(n=i,l(i))}}function Fe(e){return n=>l=>{e(l)&&n(l)}}function Ne(e){return n=>$0(n,e)}function kr(e){return n=>()=>{n(e)}}function he(e,...n){const l=Wk(...n);return((i,s)=>{switch(i){case ua:bm(e);return;case Al:return ht(e,l(s))}})}function jr(e,n){return l=>i=>{l(n=e(n,i))}}function ii(e){return n=>l=>{e>0?e--:n(l)}}function Qr(e){let n=null,l;return i=>s=>{n=s,!l&&(l=setTimeout(()=>{l=void 0,i(n)},e))}}function et(...e){const n=new Array(e.length);let l=0,i=null;const s=2**e.length-1;return e.forEach((c,d)=>{const f=2**d;ht(c,p=>{const m=l;l|=f,n[d]=p,m!==s&&l===s&&i&&(i(),i=null)})}),c=>d=>{const f=()=>{c([d].concat(n))};l===s?f():i=f}}function Wk(...e){return n=>e.reduceRight(Kk,n)}function Jk(e){let n,l;const i=()=>n==null?void 0:n();return function(s,c){switch(s){case Al:return c?l===c?void 0:(i(),l=c,n=ht(e,c),n):(i(),da);case ua:i(),l=null;return}}}function ye(e){let n=e;const l=ct();return((i,s)=>{switch(i){case Tc:n=s;break;case Al:{s(n);break}case F0:return n}return l(i,s)})}function vn(e,n){return Ac(ye(n),l=>_e(e,l))}function ct(){const e=[];return((n,l)=>{switch(n){case Tc:e.slice().forEach(i=>{i(l)});return;case ua:e.splice(0,e.length);return;case Al:return e.push(l),()=>{const i=e.indexOf(l);i>-1&&e.splice(i,1)}}})}function Zn(e){return Ac(ct(),n=>_e(e,n))}function mt(e,n=[],{singleton:l}={singleton:!0}){return{constructor:e,dependencies:n,id:ej(),singleton:l}}const ej=()=>Symbol();function tj(e){const n=new Map,l=({constructor:i,dependencies:s,id:c,singleton:d})=>{if(d&&n.has(c))return n.get(c);const f=i(s.map(p=>l(p)));return d&&n.set(c,f),f};return l(e)}function Wt(...e){const n=ct(),l=new Array(e.length);let i=0;const s=2**e.length-1;return e.forEach((c,d)=>{const f=2**d;ht(c,p=>{l[d]=p,i|=f,i===s&&We(n,l)})}),function(c,d){switch(c){case ua:{bm(n);return}case Al:return i===s&&d(l),ht(n,d)}}}function Ue(e,n=G0){return he(e,Mt(n))}function Gf(...e){return function(n,l){switch(n){case ua:return;case Al:return Zk(...e.map(i=>ht(i,l)))}}}const ln={DEBUG:0,INFO:1,WARN:2,ERROR:3},nj={[ln.DEBUG]:"debug",[ln.ERROR]:"error",[ln.INFO]:"log",[ln.WARN]:"warn"},rj=()=>typeof globalThis>"u"?window:globalThis,Ol=mt(()=>{const e=ye(ln.ERROR);return{log:ye((n,l,i=ln.INFO)=>{const s=rj().VIRTUOSO_LOG_LEVEL??It(e);i>=s&&console[nj[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,l)}),logLevel:e}},[],{singleton:!0});function si(e,n,l){return ym(e,n,l).callbackRef}function ym(e,n,l){const i=ke.useRef(null);let s=d=>{};const c=ke.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(d=>{const f=()=>{const p=d[0].target;p.offsetParent!==null&&e(p)};l?f():requestAnimationFrame(f)}):null,[e,l]);return s=d=>{d&&n?(c==null||c.observe(d),i.current=d):(i.current&&(c==null||c.unobserve(i.current)),i.current=null)},{callbackRef:s,ref:i}}function lj(e,n,l,i,s,c,d,f,p){const m=ke.useCallback(x=>{const b=ij(x.children,n,f?"offsetWidth":"offsetHeight",s);let y=x.parentElement;for(;y.dataset.virtuosoScroller===void 0;)y=y.parentElement;const v=y.lastElementChild.dataset.viewportType==="window";let w;v&&(w=y.ownerDocument.defaultView);const N=d?f?d.scrollLeft:d.scrollTop:v?f?w.scrollX||w.document.documentElement.scrollLeft:w.scrollY||w.document.documentElement.scrollTop:f?y.scrollLeft:y.scrollTop,j=d?f?d.scrollWidth:d.scrollHeight:v?f?w.document.documentElement.scrollWidth:w.document.documentElement.scrollHeight:f?y.scrollWidth:y.scrollHeight,k=d?f?d.offsetWidth:d.offsetHeight:v?f?w.innerWidth:w.innerHeight:f?y.offsetWidth:y.offsetHeight;i({scrollHeight:j,scrollTop:Math.max(N,0),viewportHeight:k}),c==null||c(f?Ub("column-gap",getComputedStyle(x).columnGap,s):Ub("row-gap",getComputedStyle(x).rowGap,s)),b!==null&&e(b)},[e,n,s,c,d,i,f]);return ym(m,l,p)}function ij(e,n,l,i){const s=e.length;if(s===0)return null;const c=[];for(let d=0;d<s;d++){const f=e.item(d);if(f.dataset.index===void 0)continue;const p=parseInt(f.dataset.index),m=parseFloat(f.dataset.knownSize),x=n(f,l);if(x===0&&i("Zero-sized element, this should not happen",{child:f},ln.ERROR),x===m)continue;const b=c[c.length-1];c.length===0||b.size!==x||b.endIndex!==p-1?c.push({endIndex:p,size:x,startIndex:p}):c[c.length-1].endIndex++}return c}function Ub(e,n,l){return n!=="normal"&&(n==null?void 0:n.endsWith("px"))!==!0&&l(`${e} was not resolved to pixel value correctly`,n,ln.WARN),n==="normal"?0:parseInt(n??"0",10)}function q0(e,n,l){const i=ke.useRef(null),s=ke.useCallback(p=>{if(!(p!=null&&p.offsetParent))return;const m=p.getBoundingClientRect(),x=m.width;let b,y;if(n){const v=n.getBoundingClientRect(),w=m.top-v.top;y=v.height-Math.max(0,w),b=w+n.scrollTop}else{const v=d.current.ownerDocument.defaultView;y=v.innerHeight-Math.max(0,m.top),b=m.top+v.scrollY}i.current={offsetTop:b,visibleHeight:y,visibleWidth:x},e(i.current)},[e,n]),{callbackRef:c,ref:d}=ym(s,!0,l),f=ke.useCallback(()=>{s(d.current)},[s,d]);return ke.useEffect(()=>{var m;if(n){n.addEventListener("scroll",f);const x=new ResizeObserver(()=>{requestAnimationFrame(f)});return x.observe(n),()=>{n.removeEventListener("scroll",f),x.unobserve(n)}}const p=(m=d.current)==null?void 0:m.ownerDocument.defaultView;return p==null||p.addEventListener("scroll",f),p==null||p.addEventListener("resize",f),()=>{p==null||p.removeEventListener("scroll",f),p==null||p.removeEventListener("resize",f)}},[f,n,d]),c}const En=mt(()=>{const e=ct(),n=ct(),l=ye(0),i=ct(),s=ye(0),c=ct(),d=ct(),f=ye(0),p=ye(0),m=ye(0),x=ye(0),b=ct(),y=ct(),v=ye(!1),w=ye(!1),N=ye(!1);return _e(he(e,Ne(({scrollTop:j})=>j)),n),_e(he(e,Ne(({scrollHeight:j})=>j)),d),_e(n,s),{deviation:l,fixedFooterHeight:m,fixedHeaderHeight:p,footerHeight:x,headerHeight:f,horizontalDirection:w,scrollBy:y,scrollContainerState:e,scrollHeight:d,scrollingInProgress:v,scrollTo:b,scrollTop:n,skipAnimationFrameInResizeObserver:N,smoothScrollTargetReached:i,statefulScrollTop:s,viewportHeight:c}},[],{singleton:!0}),Ss={lvl:0};function V0(e,n){const l=e.length;if(l===0)return[];let{index:i,value:s}=n(e[0]);const c=[];for(let d=1;d<l;d++){const{index:f,value:p}=n(e[d]);c.push({end:f-1,start:i,value:s}),i=f,s=p}return c.push({end:1/0,start:i,value:s}),c}function jt(e){return e===Ss}function ws(e,n){if(!jt(e))return n===e.k?e.v:n<e.k?ws(e.l,n):ws(e.r,n)}function xr(e,n,l="k"){if(jt(e))return[-1/0,void 0];if(Number(e[l])===n)return[e.k,e.v];if(Number(e[l])<n){const i=xr(e.r,n,l);return i[0]===-1/0?[e.k,e.v]:i}return xr(e.l,n,l)}function Qn(e,n,l){return jt(e)?P0(n,l,1):n===e.k?rn(e,{k:n,v:l}):n<e.k?Fb(rn(e,{l:Qn(e.l,n,l)})):Fb(rn(e,{r:Qn(e.r,n,l)}))}function ia(){return Ss}function aa(e,n,l){if(jt(e))return[];const i=xr(e,n)[0];return aj(Vf(e,i,l))}function qf(e,n){if(jt(e))return Ss;const{k:l,l:i,r:s}=e;if(n===l){if(jt(i))return s;if(jt(s))return i;const[c,d]=X0(i);return dc(rn(e,{k:c,l:Y0(i),v:d}))}return n<l?dc(rn(e,{l:qf(i,n)})):dc(rn(e,{r:qf(s,n)}))}function ni(e){return jt(e)?[]:[...ni(e.l),{k:e.k,v:e.v},...ni(e.r)]}function Vf(e,n,l){if(jt(e))return[];const{k:i,l:s,r:c,v:d}=e;let f=[];return i>n&&(f=f.concat(Vf(s,n,l))),i>=n&&i<=l&&f.push({k:i,v:d}),i<=l&&(f=f.concat(Vf(c,n,l))),f}function dc(e){const{l:n,lvl:l,r:i}=e;if(i.lvl>=l-1&&n.lvl>=l-1)return e;if(l>i.lvl+1){if(hf(n))return Q0(rn(e,{lvl:l-1}));if(!jt(n)&&!jt(n.r))return rn(n.r,{l:rn(n,{r:n.r.l}),lvl:l,r:rn(e,{l:n.r.r,lvl:l-1})});throw new Error("Unexpected empty nodes")}if(hf(e))return Yf(rn(e,{lvl:l-1}));if(!jt(i)&&!jt(i.l)){const s=i.l,c=hf(s)?i.lvl-1:i.lvl;return rn(s,{l:rn(e,{lvl:l-1,r:s.l}),lvl:s.lvl+1,r:Yf(rn(i,{l:s.r,lvl:c}))})}throw new Error("Unexpected empty nodes")}function rn(e,n){return P0(n.k!==void 0?n.k:e.k,n.v!==void 0?n.v:e.v,n.lvl!==void 0?n.lvl:e.lvl,n.l!==void 0?n.l:e.l,n.r!==void 0?n.r:e.r)}function Y0(e){return jt(e.r)?e.l:dc(rn(e,{r:Y0(e.r)}))}function hf(e){return jt(e)||e.lvl>e.r.lvl}function X0(e){return jt(e.r)?[e.k,e.v]:X0(e.r)}function P0(e,n,l,i=Ss,s=Ss){return{k:e,l:i,lvl:l,r:s,v:n}}function Fb(e){return Yf(Q0(e))}function Q0(e){const{l:n}=e;return!jt(n)&&n.lvl===e.lvl?rn(n,{r:rn(e,{l:n.r})}):e}function Yf(e){const{lvl:n,r:l}=e;return!jt(l)&&!jt(l.r)&&l.lvl===n&&l.r.lvl===n?rn(l,{l:rn(e,{r:l.l}),lvl:n+1}):e}function aj(e){return V0(e,({k:n,v:l})=>({index:n,value:l}))}function Z0(e,n){return!!(e&&e.startIndex===n.startIndex&&e.endIndex===n.endIndex)}function ks(e,n){return!!(e&&e[0]===n[0]&&e[1]===n[1])}const vm=mt(()=>({recalcInProgress:ye(!1)}),[],{singleton:!0});function K0(e,n,l){return e[bc(e,n,l)]}function bc(e,n,l,i=0){let s=e.length-1;for(;i<=s;){const c=Math.floor((i+s)/2),d=e[c],f=l(d,n);if(f===0)return c;if(f===-1){if(s-i<2)return c-1;s=c-1}else{if(s===i)return c;i=c+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${n}`)}function sj(e,n,l,i){const s=bc(e,n,i),c=bc(e,l,i,s);return e.slice(s,c+1)}function Tl(e,n){return Math.round(e.getBoundingClientRect()[n])}function Oc(e){return!jt(e.groupOffsetTree)}function Sm({index:e},n){return n===e?0:n<e?-1:1}function oj(){return{groupIndices:[],groupOffsetTree:ia(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:ia()}}function cj(e,n){let l=jt(e)?0:1/0;for(const i of n){const{endIndex:s,size:c,startIndex:d}=i;if(l=Math.min(l,d),jt(e)){e=Qn(e,0,c);continue}const f=aa(e,d-1,s+1);if(f.some(gj(i)))continue;let p=!1,m=!1;for(const{end:x,start:b,value:y}of f)p?(s>=b||c===y)&&(e=qf(e,b)):(m=y!==c,p=!0),x>s&&s>=b&&y!==c&&(e=Qn(e,s+1,y));m&&(e=Qn(e,d,c))}return[e,l]}function uj(e){return typeof e.groupIndex<"u"}function dj({offset:e},n){return n===e?0:n<e?-1:1}function js(e,n,l){if(n.length===0)return 0;const{index:i,offset:s,size:c}=K0(n,e,Sm),d=e-i,f=c*d+(d-1)*l+s;return f>0?f+l:f}function W0(e,n){if(!Oc(n))return e;let l=0;for(;n.groupIndices[l]<=e+l;)l++;return e+l}function J0(e,n,l){if(uj(e))return n.groupIndices[e.groupIndex]+1;const i=e.index==="LAST"?l:e.index;let s=W0(i,n);return s=Math.max(0,s,Math.min(l,s)),s}function fj(e,n,l,i=0){return i>0&&(n=Math.max(n,K0(e,i,Sm).offset)),V0(sj(e,n,l,dj),hj)}function mj(e,[n,l,i,s]){n.length>0&&i("received item sizes",n,ln.DEBUG);const c=e.sizeTree;let d=c,f=0;if(l.length>0&&jt(c)&&n.length===2){const y=n[0].size,v=n[1].size;d=l.reduce((w,N)=>Qn(Qn(w,N,y),N+1,v),d)}else[d,f]=cj(d,n);if(d===c)return e;const{lastIndex:p,lastOffset:m,lastSize:x,offsetTree:b}=Xf(e.offsetTree,f,d,s);return{groupIndices:l,groupOffsetTree:l.reduce((y,v)=>Qn(y,v,js(v,b,s)),ia()),lastIndex:p,lastOffset:m,lastSize:x,offsetTree:b,sizeTree:d}}function pj(e){return ni(e).map(({k:n,v:l},i,s)=>{const c=s[i+1];return{endIndex:c!==void 0?c.k-1:1/0,size:l,startIndex:n}})}function $b(e,n){let l=0,i=0;for(;l<e;)l+=n[i+1]-n[i]-1,i++;return i-(l===e?0:1)}function Xf(e,n,l,i){let s=e,c=0,d=0,f=0,p=0;if(n!==0){p=bc(s,n-1,Sm),f=s[p].offset;const m=xr(l,n-1);c=m[0],d=m[1],s.length&&s[p].size===xr(l,n)[1]&&(p-=1),s=s.slice(0,p+1)}else s=[];for(const{start:m,value:x}of aa(l,n,1/0)){const b=m-c,y=b*d+f+b*i;s.push({index:m,offset:y,size:x}),c=m,f=y,d=x}return{lastIndex:c,lastOffset:f,lastSize:d,offsetTree:s}}function hj(e){return{index:e.index,value:e}}function gj(e){const{endIndex:n,size:l,startIndex:i}=e;return s=>s.start===i&&(s.end===n||s.end===1/0)&&s.value===l}const xj={offsetHeight:"height",offsetWidth:"width"},Nr=mt(([{log:e},{recalcInProgress:n}])=>{const l=ct(),i=ct(),s=vn(i,0),c=ct(),d=ct(),f=ye(0),p=ye([]),m=ye(void 0),x=ye(void 0),b=ye(void 0),y=ye(void 0),v=ye((R,X)=>Tl(R,xj[X])),w=ye(void 0),N=ye(0),j=oj(),k=vn(he(l,et(p,e,N),jr(mj,j),Mt()),j),T=vn(he(p,Mt(),jr((R,X)=>({current:X,prev:R.current}),{current:[],prev:[]}),Ne(({prev:R})=>R)),[]);_e(he(p,Fe(R=>R.length>0),et(k,N),Ne(([R,X,U])=>{const D=R.reduce((Q,M,V)=>Qn(Q,M,js(M,X.offsetTree,U)||V),ia());return{...X,groupIndices:R,groupOffsetTree:D}})),k),_e(he(i,et(k),Fe(([R,{lastIndex:X}])=>R<X),Ne(([R,{lastIndex:X,lastSize:U}])=>[{endIndex:X,size:U,startIndex:R}])),l),_e(m,x);const C=vn(he(m,Ne(R=>R===void 0)),!0);_e(he(x,Fe(R=>R!==void 0&&jt(It(k).sizeTree)),Ne(R=>{const X=It(b),U=It(p).length>0;return X!==void 0&&X!==0?U?[{endIndex:0,size:X,startIndex:0},{endIndex:1,size:R,startIndex:1}]:[]:[{endIndex:0,size:R,startIndex:0}]})),l),_e(he(y,Fe(R=>R!==void 0&&R.length>0&&jt(It(k).sizeTree)),Ne(R=>{const X=[];let U=R[0],D=0;for(let Q=1;Q<R.length;Q++){const M=R[Q];M!==U&&(X.push({endIndex:Q-1,size:U,startIndex:D}),U=M,D=Q)}return X.push({endIndex:R.length-1,size:U,startIndex:D}),X})),l),_e(he(p,et(b,x),Fe(([,R,X])=>R!==void 0&&X!==void 0),Ne(([R,X,U])=>{const D=[];for(let Q=0;Q<R.length;Q++){const M=R[Q],V=R[Q+1];D.push({startIndex:M,endIndex:M,size:X}),V!==void 0&&D.push({startIndex:M+1,endIndex:V-1,size:U})}return D})),l);const L=Zn(he(l,et(k),jr(({sizes:R},[X,U])=>({changed:U!==R,sizes:U}),{changed:!1,sizes:j}),Ne(R=>R.changed)));ht(he(f,jr((R,X)=>({diff:R.prev-X,prev:X}),{diff:0,prev:0}),Ne(R=>R.diff)),R=>{const{groupIndices:X}=It(k);if(R>0)We(n,!0),We(c,R+$b(R,X));else if(R<0){const U=It(T);U.length>0&&(R-=$b(-R,U)),We(d,R)}}),ht(he(f,et(e)),([R,X])=>{R<0&&X("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:f},ln.ERROR)});const G=Zn(c);_e(he(c,et(k),Ne(([R,X])=>{const U=X.groupIndices.length>0,D=[],Q=X.lastSize;if(U){const M=ws(X.sizeTree,0);let V=0,H=0;for(;V<R;){const B=X.groupIndices[H],P=X.groupIndices.length===H+1?1/0:X.groupIndices[H+1]-B-1;D.push({endIndex:B,size:M,startIndex:B}),D.push({endIndex:B+1+P-1,size:Q,startIndex:B+1}),H++,V+=P+1}const q=ni(X.sizeTree);return V!==R&&q.shift(),q.reduce((B,{k:P,v:oe})=>{let ae=B.ranges;return B.prevSize!==0&&(ae=[...B.ranges,{endIndex:P+R-1,size:B.prevSize,startIndex:B.prevIndex}]),{prevIndex:P+R,prevSize:oe,ranges:ae}},{prevIndex:R,prevSize:0,ranges:D}).ranges}return ni(X.sizeTree).reduce((M,{k:V,v:H})=>({prevIndex:V+R,prevSize:H,ranges:[...M.ranges,{endIndex:V+R-1,size:M.prevSize,startIndex:M.prevIndex}]}),{prevIndex:0,prevSize:Q,ranges:[]}).ranges})),l);const I=Zn(he(d,et(k,N),Ne(([R,{offsetTree:X},U])=>{const D=-R;return js(D,X,U)})));return _e(he(d,et(k,N),Ne(([R,X,U])=>{if(X.groupIndices.length>0){if(jt(X.sizeTree))return X;let Q=ia();const M=It(T);let V=0,H=0,q=0;for(;V<-R;){q=M[H];const B=M[H+1]-q-1;H++,V+=B+1}if(Q=ni(X.sizeTree).reduce((B,{k:P,v:oe})=>Qn(B,Math.max(0,P+R),oe),Q),V!==-R){const B=ws(X.sizeTree,q);Q=Qn(Q,0,B);const P=xr(X.sizeTree,-R+1)[1];Q=Qn(Q,1,P)}return{...X,sizeTree:Q,...Xf(X.offsetTree,0,Q,U)}}const D=ni(X.sizeTree).reduce((Q,{k:M,v:V})=>Qn(Q,Math.max(0,M+R),V),ia());return{...X,sizeTree:D,...Xf(X.offsetTree,0,D,U)}})),k),{beforeUnshiftWith:G,data:w,defaultItemSize:x,firstItemIndex:f,fixedItemSize:m,fixedGroupSize:b,gap:N,groupIndices:p,heightEstimates:y,itemSize:v,listRefresh:L,shiftWith:d,shiftWithOffset:I,sizeRanges:l,sizes:k,statefulTotalCount:s,totalCount:i,trackItemSizes:C,unshiftWith:c}},zt(Ol,vm),{singleton:!0});function bj(e){return e.reduce((n,l)=>(n.groupIndices.push(n.totalCount),n.totalCount+=l+1,n),{groupIndices:[],totalCount:0})}const ev=mt(([{groupIndices:e,sizes:n,totalCount:l},{headerHeight:i,scrollTop:s}])=>{const c=ct(),d=ct(),f=Zn(he(c,Ne(bj)));return _e(he(f,Ne(p=>p.totalCount)),l),_e(he(f,Ne(p=>p.groupIndices)),e),_e(he(Wt(s,n,i),Fe(([p,m])=>Oc(m)),Ne(([p,m,x])=>xr(m.groupOffsetTree,Math.max(p-x,0),"v")[0]),Mt(),Ne(p=>[p])),d),{groupCounts:c,topItemsIndexes:d}},zt(Nr,En)),_l=mt(([{log:e}])=>{const n=ye(!1),l=Zn(he(n,Fe(i=>i),Mt()));return ht(n,i=>{i&&It(e)("props updated",{},ln.DEBUG)}),{didMount:l,propsReady:n}},zt(Ol),{singleton:!0}),yj=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function tv(e){const n=typeof e=="number"?{index:e}:e;return n.align||(n.align="start"),(!n.behavior||!yj)&&(n.behavior="auto"),n.offset===void 0&&(n.offset=0),n}const Ls=mt(([{gap:e,listRefresh:n,sizes:l,totalCount:i},{fixedFooterHeight:s,fixedHeaderHeight:c,footerHeight:d,headerHeight:f,scrollingInProgress:p,scrollTo:m,smoothScrollTargetReached:x,viewportHeight:b},{log:y}])=>{const v=ct(),w=ct(),N=ye(0);let j=null,k=null,T=null;function C(){j!==null&&(j(),j=null),T!==null&&(T(),T=null),k&&(clearTimeout(k),k=null),We(p,!1)}return _e(he(v,et(l,b,i,N,f,d,y),et(e,c,s),Ne(([[L,G,I,R,X,U,D,Q],M,V,H])=>{const q=tv(L),{align:B,behavior:P,offset:oe}=q,ae=R-1,A=J0(q,G,ae);let z=js(A,G.offsetTree,M)+U;B==="end"?(z+=V+xr(G.sizeTree,A)[1]-I+H,A===ae&&(z+=D)):B==="center"?z+=(V+xr(G.sizeTree,A)[1]-I+H)/2:z-=X,oe!==void 0&&oe!==0&&(z+=oe);const W=O=>{C(),O?(Q("retrying to scroll to",{location:L},ln.DEBUG),We(v,L)):(We(w,!0),Q("list did not change, scroll successful",{},ln.DEBUG))};if(C(),P==="smooth"){let O=!1;T=ht(n,$=>{O=O||$}),j=hr(x,()=>{W(O)})}else j=hr(he(n,vj(150)),W);return k=setTimeout(()=>{C()},1200),We(p,!0),Q("scrolling from index to",{behavior:P,index:A,top:z},ln.DEBUG),{behavior:P,top:z}})),m),{scrollTargetReached:w,scrollToIndex:v,topListHeight:N}},zt(Nr,En,Ol),{singleton:!0});function vj(e){return n=>{const l=setTimeout(()=>{n(!1)},e);return i=>{i&&(n(!0),clearTimeout(l))}}}function wm(e,n){e===0?n():requestAnimationFrame(()=>{wm(e-1,n)})}function km(e,n){const l=n-1;return typeof e=="number"?e:e.index==="LAST"?l:e.index}const Is=mt(([{defaultItemSize:e,listRefresh:n,sizes:l},{scrollTop:i},{scrollTargetReached:s,scrollToIndex:c},{didMount:d}])=>{const f=ye(!0),p=ye(0),m=ye(!0);return _e(he(d,et(p),Fe(([x,b])=>b!==0),kr(!1)),f),_e(he(d,et(p),Fe(([x,b])=>b!==0),kr(!1)),m),ht(he(Wt(n,d),et(f,l,e,m),Fe(([[,x],b,{sizeTree:y},v,w])=>x&&(!jt(y)||xm(v))&&!b&&!w),et(p)),([,x])=>{hr(s,()=>{We(m,!0)}),wm(4,()=>{hr(i,()=>{We(f,!0)}),We(c,x)})}),{initialItemFinalLocationReached:m,initialTopMostItemIndex:p,scrolledToInitialItem:f}},zt(Nr,En,Ls,_l),{singleton:!0});function nv(e,n){return Math.abs(e-n)<1.01}const Ns="up",hs="down",Sj="none",wj={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},kj=0,Bs=mt(([{footerHeight:e,headerHeight:n,scrollBy:l,scrollContainerState:i,scrollTop:s,viewportHeight:c}])=>{const d=ye(!1),f=ye(!0),p=ct(),m=ct(),x=ye(4),b=ye(kj),y=vn(he(Gf(he(Ue(s),ii(1),kr(!0)),he(Ue(s),ii(1),kr(!1),Hb(100))),Mt()),!1),v=vn(he(Gf(he(l,kr(!0)),he(l,kr(!1),Hb(200))),Mt()),!1);_e(he(Wt(Ue(s),Ue(b)),Ne(([T,C])=>T<=C),Mt()),f),_e(he(f,Qr(50)),m);const w=Zn(he(Wt(i,Ue(c),Ue(n),Ue(e),Ue(x)),jr((T,[{scrollHeight:C,scrollTop:L},G,I,R,X])=>{const U=L+G-C>-X,D={scrollHeight:C,scrollTop:L,viewportHeight:G};if(U){let M,V;return L>T.state.scrollTop?(M="SCROLLED_DOWN",V=T.state.scrollTop-L):(M="SIZE_DECREASED",V=T.state.scrollTop-L||T.scrollTopDelta),{atBottom:!0,atBottomBecause:M,scrollTopDelta:V,state:D}}let Q;return D.scrollHeight>T.state.scrollHeight?Q="SIZE_INCREASED":G<T.state.viewportHeight?Q="VIEWPORT_HEIGHT_DECREASING":L<T.state.scrollTop?Q="SCROLLING_UPWARDS":Q="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:Q,state:D}},wj),Mt((T,C)=>T!==void 0&&T.atBottom===C.atBottom))),N=vn(he(i,jr((T,{scrollHeight:C,scrollTop:L,viewportHeight:G})=>{if(!nv(T.scrollHeight,C)){const I=C-(L+G)<1;return T.scrollTop!==L&&I?{changed:!0,jump:T.scrollTop-L,scrollHeight:C,scrollTop:L}:{changed:!0,jump:0,scrollHeight:C,scrollTop:L}}return{changed:!1,jump:0,scrollHeight:C,scrollTop:L}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Fe(T=>T.changed),Ne(T=>T.jump)),0);_e(he(w,Ne(T=>T.atBottom)),d),_e(he(d,Qr(50)),p);const j=ye(hs);_e(he(i,Ne(({scrollTop:T})=>T),Mt(),jr((T,C)=>It(v)?{direction:T.direction,prevScrollTop:C}:{direction:C<T.prevScrollTop?Ns:hs,prevScrollTop:C},{direction:hs,prevScrollTop:0}),Ne(T=>T.direction)),j),_e(he(i,Qr(50),kr(Sj)),j);const k=ye(0);return _e(he(y,Fe(T=>!T),kr(0)),k),_e(he(s,Qr(100),et(y),Fe(([T,C])=>C),jr(([T,C],[L])=>[C,L],[0,0]),Ne(([T,C])=>C-T)),k),{atBottomState:w,atBottomStateChange:p,atBottomThreshold:x,atTopStateChange:m,atTopThreshold:b,isAtBottom:d,isAtTop:f,isScrolling:y,lastJumpDueToItemResize:N,scrollDirection:j,scrollVelocity:k}},zt(En)),Cs="top",Es="bottom",Gb="none";function qb(e,n,l){return typeof e=="number"?l===Ns&&n===Cs||l===hs&&n===Es?e:0:l===Ns?n===Cs?e.main:e.reverse:n===Es?e.main:e.reverse}function Vb(e,n){return typeof e=="number"?e:e[n]??0}const jm=mt(([{deviation:e,fixedHeaderHeight:n,headerHeight:l,scrollTop:i,viewportHeight:s}])=>{const c=ct(),d=ye(0),f=ye(0),p=ye(0),m=vn(he(Wt(Ue(i),Ue(s),Ue(l),Ue(c,ks),Ue(p),Ue(d),Ue(n),Ue(e),Ue(f)),Ne(([x,b,y,[v,w],N,j,k,T,C])=>{const L=x-T,G=j+k,I=Math.max(y-L,0);let R=Gb;const X=Vb(C,Cs),U=Vb(C,Es);return v-=T,v+=y+k,w+=y+k,w-=T,v>x+G-X&&(R=Ns),w<x-I+b+U&&(R=hs),R!==Gb?[Math.max(L-y-qb(N,Cs,R)-X,0),L-I-k+b+qb(N,Es,R)+U]:null}),Fe(x=>x!==null),Mt(ks)),[0,0]);return{increaseViewportBy:f,listBoundary:c,overscan:p,topListHeight:d,visibleRange:m}},zt(En),{singleton:!0});function jj(e,n,l){if(Oc(n)){const i=W0(e,n);return[{index:xr(n.groupOffsetTree,i)[0],offset:0,size:0},{data:l==null?void 0:l[0],index:i,offset:0,size:0}]}return[{data:l==null?void 0:l[0],index:e,offset:0,size:0}]}const gf={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function fc(e,n,l,i,s,c){const{lastIndex:d,lastOffset:f,lastSize:p}=s;let m=0,x=0;if(e.length>0){m=e[0].offset;const N=e[e.length-1];x=N.offset+N.size}const b=l-d,y=f+b*p+(b-1)*i,v=m,w=y-x;return{bottom:x,firstItemIndex:c,items:Yb(e,s,c),offsetBottom:w,offsetTop:m,top:v,topItems:Yb(n,s,c),topListHeight:n.reduce((N,j)=>j.size+N,0),totalCount:l}}function rv(e,n,l,i,s,c){let d=0;if(l.groupIndices.length>0)for(const x of l.groupIndices){if(x-d>=e)break;d++}const f=e+d,p=km(n,f),m=Array.from({length:f}).map((x,b)=>({data:c[b+p],index:b+p,offset:0,size:0}));return fc(m,[],f,s,l,i)}function Yb(e,n,l){if(e.length===0)return[];if(!Oc(n))return e.map(m=>({...m,index:m.index+l,originalIndex:m.index}));const i=e[0].index,s=e[e.length-1].index,c=[],d=aa(n.groupOffsetTree,i,s);let f,p=0;for(const m of e){(!f||f.end<m.index)&&(f=d.shift(),p=n.groupIndices.indexOf(f.start));let x;m.index===f.start?x={index:p,type:"group"}:x={groupIndex:p,index:m.index-(p+1)+l},c.push({...x,data:m.data,offset:m.offset,originalIndex:m.index,size:m.size})}return c}function Xb(e,n){return e===void 0?0:typeof e=="number"?e:e[n]??0}const oi=mt(([{data:e,firstItemIndex:n,gap:l,sizes:i,totalCount:s},c,{listBoundary:d,topListHeight:f,visibleRange:p},{initialTopMostItemIndex:m,scrolledToInitialItem:x},{topListHeight:b},y,{didMount:v},{recalcInProgress:w}])=>{const N=ye([]),j=ye(0),k=ct(),T=ye(0);_e(c.topItemsIndexes,N);const C=vn(he(Wt(v,w,Ue(p,ks),Ue(s),Ue(i),Ue(m),x,Ue(N),Ue(n),Ue(l),Ue(T),e),Fe(([R,X,,U,,,,,,,,D])=>{const Q=D!==void 0&&D.length!==U;return R&&!X&&!Q}),Ne(([,,[R,X],U,D,Q,M,V,H,q,B,P])=>{var xe,Te;const oe=D,{offsetTree:ae,sizeTree:A}=oe,z=It(j);if(U===0)return{...gf,totalCount:U};if(R===0&&X===0)return z===0?{...gf,totalCount:U}:rv(z,Q,D,H,q,P||[]);if(jt(A))return z>0?null:fc(jj(km(Q,U),oe,P),[],U,q,oe,H);const W=[];if(V.length>0){const je=V[0],He=V[V.length-1];let fe=0;for(const Ce of aa(A,je,He)){const Re=Ce.value,$e=Math.max(Ce.start,je),Je=Math.min(Ce.end,He);for(let Ge=$e;Ge<=Je;Ge++)W.push({data:P==null?void 0:P[Ge],index:Ge,offset:fe,size:Re}),fe+=Re}}if(!M)return fc([],W,U,q,oe,H);const O=V.length>0?V[V.length-1]+1:0,$=fj(ae,R,X,O);if($.length===0)return null;const ee=U-1,re=Ac([],je=>{for(const He of $){const fe=He.value;let Ce=fe.offset,Re=He.start;const $e=fe.size;if(fe.offset<R){Re+=Math.floor((R-fe.offset+q)/($e+q));const Ge=Re-He.start;Ce+=Ge*$e+Ge*q}Re<O&&(Ce+=(O-Re)*$e,Re=O);const Je=Math.min(He.end,ee);for(let Ge=Re;Ge<=Je&&!(Ce>=X);Ge++)je.push({data:P==null?void 0:P[Ge],index:Ge,offset:Ce,size:$e}),Ce+=$e+q}}),Y=Xb(B,Cs),le=Xb(B,Es);if(re.length>0&&(Y>0||le>0)){const je=re[0],He=re[re.length-1];if(Y>0&&je.index>O){const fe=Math.min(Y,je.index-O),Ce=[];let Re=je.offset;for(let $e=je.index-1;$e>=je.index-fe;$e--){const Je=((xe=aa(A,$e,$e)[0])==null?void 0:xe.value)??je.size;Re-=Je+q,Ce.unshift({data:P==null?void 0:P[$e],index:$e,offset:Re,size:Je})}re.unshift(...Ce)}if(le>0&&He.index<ee){const fe=Math.min(le,ee-He.index);let Ce=He.offset+He.size+q;for(let Re=He.index+1;Re<=He.index+fe;Re++){const $e=((Te=aa(A,Re,Re)[0])==null?void 0:Te.value)??He.size;re.push({data:P==null?void 0:P[Re],index:Re,offset:Ce,size:$e}),Ce+=$e+q}}}return fc(re,W,U,q,oe,H)}),Fe(R=>R!==null),Mt()),gf);_e(he(e,Fe(xm),Ne(R=>R==null?void 0:R.length)),s),_e(he(C,Ne(R=>R.topListHeight)),b),_e(b,f),_e(he(C,Ne(R=>[R.top,R.bottom])),d),_e(he(C,Ne(R=>R.items)),k);const L=Zn(he(C,Fe(({items:R})=>R.length>0),et(s,e),Fe(([{items:R},X])=>R[R.length-1].originalIndex===X-1),Ne(([,R,X])=>[R-1,X]),Mt(ks),Ne(([R])=>R))),G=Zn(he(C,Qr(200),Fe(({items:R,topItems:X})=>R.length>0&&R[0].originalIndex===X.length),Ne(({items:R})=>R[0].index),Mt())),I=Zn(he(C,Fe(({items:R})=>R.length>0),Ne(({items:R})=>{let X=0,U=R.length-1;for(;R[X].type==="group"&&X<U;)X++;for(;R[U].type==="group"&&U>X;)U--;return{endIndex:R[U].index,startIndex:R[X].index}}),Mt(Z0)));return{endReached:L,initialItemCount:j,itemsRendered:k,listState:C,minOverscanItemCount:T,rangeChanged:I,startReached:G,topItemsIndexes:N,...y}},zt(Nr,ev,jm,Is,Ls,Bs,_l,vm),{singleton:!0}),lv=mt(([{fixedFooterHeight:e,fixedHeaderHeight:n,footerHeight:l,headerHeight:i},{listState:s}])=>{const c=ct(),d=vn(he(Wt(l,e,i,n,s),Ne(([f,p,m,x,b])=>f+p+m+x+b.offsetBottom+b.bottom)),0);return _e(Ue(d),c),{totalListHeight:d,totalListHeightChanged:c}},zt(En,oi),{singleton:!0}),Nj=mt(([{viewportHeight:e},{totalListHeight:n}])=>{const l=ye(!1),i=vn(he(Wt(l,e,n),Fe(([s])=>s),Ne(([,s,c])=>Math.max(0,s-c)),Qr(0),Mt()),0);return{alignToBottom:l,paddingTopAddition:i}},zt(En,lv),{singleton:!0}),iv=mt(()=>({context:ye(null)})),Cj=({itemBottom:e,itemTop:n,locationParams:{align:l,behavior:i,...s},viewportBottom:c,viewportTop:d})=>n<d?{...s,align:l??"start",...i!==void 0?{behavior:i}:{}}:e>c?{...s,align:l??"end",...i!==void 0?{behavior:i}:{}}:null,av=mt(([{gap:e,sizes:n,totalCount:l},{fixedFooterHeight:i,fixedHeaderHeight:s,headerHeight:c,scrollingInProgress:d,scrollTop:f,viewportHeight:p},{scrollToIndex:m}])=>{const x=ct();return _e(he(x,et(n,p,l,c,s,i,f),et(e),Ne(([[b,y,v,w,N,j,k,T],C])=>{const{calculateViewLocation:L=Cj,done:G,...I}=b,R=J0(b,y,w-1),X=js(R,y.offsetTree,C)+N+j,U=X+xr(y.sizeTree,R)[1],D=T+j,Q=T+v-k,M=L({itemBottom:U,itemTop:X,locationParams:I,viewportBottom:Q,viewportTop:D});return M!==null?G&&hr(he(d,Fe(V=>!V),ii(It(d)?1:2)),G):G==null||G(),M}),Fe(b=>b!==null)),m),{scrollIntoView:x}},zt(Nr,En,Ls,oi,Ol),{singleton:!0});function Pb(e){return e===!1?!1:e==="smooth"?"smooth":"auto"}const Ej=(e,n)=>typeof e=="function"?Pb(e(n)):n&&Pb(e),Tj=mt(([{listRefresh:e,totalCount:n,fixedItemSize:l,data:i},{atBottomState:s,isAtBottom:c},{scrollToIndex:d},{scrolledToInitialItem:f},{didMount:p,propsReady:m},{log:x},{scrollingInProgress:b},{context:y},{scrollIntoView:v}])=>{const w=ye(!1),N=ct();let j=null;function k(G){We(d,{align:"end",behavior:G,index:"LAST"})}ht(he(Wt(he(Ue(n),ii(1)),p),et(Ue(w),c,f,b),Ne(([[G,I],R,X,U,D])=>{let Q=I&&U,M="auto";return Q&&(M=Ej(R,X||D),Q=Q&&M!==!1),{followOutputBehavior:M,shouldFollow:Q,totalCount:G}}),Fe(({shouldFollow:G})=>G)),({followOutputBehavior:G,totalCount:I})=>{j!==null&&(j(),j=null),It(l)!==void 0?requestAnimationFrame(()=>{It(x)("following output to ",{totalCount:I},ln.DEBUG),k(G)}):j=hr(e,()=>{It(x)("following output to ",{totalCount:I},ln.DEBUG),k(G),j=null})});function T(G){const I=hr(s,R=>{G&&!R.atBottom&&R.notAtBottomBecause==="SIZE_INCREASED"&&j===null&&(It(x)("scrolling to bottom due to increased size",{},ln.DEBUG),k("auto"))});setTimeout(I,100)}ht(he(Wt(Ue(w),n,m),Fe(([G,,I])=>G!==!1&&I),jr(({value:G},[,I])=>({refreshed:G===I,value:I}),{refreshed:!1,value:0}),Fe(({refreshed:G})=>G),et(w,n)),([,G])=>{It(f)&&T(G!==!1)}),ht(N,()=>{T(It(w)!==!1)}),ht(Wt(Ue(w),s),([G,I])=>{G!==!1&&!I.atBottom&&I.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&k("auto")});const C=ye(null),L=ct();return _e(Gf(he(Ue(i),Ne(G=>(G==null?void 0:G.length)??0)),he(Ue(n))),L),ht(he(Wt(he(L,ii(1)),p),et(Ue(C),f,b,y),Ne(([[G,I],R,X,U,D])=>I&&X&&(R==null?void 0:R({context:D,totalCount:G,scrollingInProgress:U}))),Fe(G=>!!G),Qr(0)),G=>{j!==null&&(j(),j=null),It(l)!==void 0?requestAnimationFrame(()=>{It(x)("scrolling into view",{}),We(v,G)}):j=hr(e,()=>{It(x)("scrolling into view",{}),We(v,G),j=null})}),{autoscrollToBottom:N,followOutput:w,scrollIntoViewOnChange:C}},zt(Nr,Bs,Ls,Is,_l,Ol,En,iv,av)),Aj=mt(([{data:e,firstItemIndex:n,gap:l,sizes:i},{initialTopMostItemIndex:s},{initialItemCount:c,listState:d},{didMount:f}])=>(_e(he(f,et(c),Fe(([,p])=>p!==0),et(s,i,n,l,e),Ne(([[,p],m,x,b,y,v=[]])=>rv(p,m,x,b,y,v))),d),{}),zt(Nr,Is,oi,_l),{singleton:!0}),Oj=mt(([{didMount:e},{scrollTo:n},{listState:l}])=>{const i=ye(0);return ht(he(e,et(i),Fe(([,s])=>s!==0),Ne(([,s])=>({top:s}))),s=>{hr(he(l,ii(1),Fe(c=>c.items.length>1)),()=>{requestAnimationFrame(()=>{We(n,s)})})}),{initialScrollTop:i}},zt(_l,En,oi),{singleton:!0}),sv=mt(([{scrollVelocity:e}])=>{const n=ye(!1),l=ct(),i=ye(!1);return _e(he(e,et(i,n,l),Fe(([s,c])=>c!==!1&&c!==void 0),Ne(([s,c,d,f])=>{const{enter:p,exit:m}=c;if(d){if(m(s,f))return!1}else if(p(s,f))return!0;return d}),Mt()),n),ht(he(Wt(n,e,l),et(i)),([[s,c,d],f])=>{s&&f!==!1&&f!==void 0&&f.change&&f.change(c,d)}),{isSeeking:n,scrollSeekConfiguration:i,scrollSeekRangeChanged:l,scrollVelocity:e}},zt(Bs),{singleton:!0}),Nm=mt(([{scrollContainerState:e,scrollTo:n}])=>{const l=ct(),i=ct(),s=ct(),c=ye(!1),d=ye(void 0);return _e(he(Wt(l,i),Ne(([{scrollHeight:f,scrollTop:p,viewportHeight:m},{offsetTop:x}])=>({scrollHeight:f,scrollTop:Math.max(0,p-x),viewportHeight:m}))),e),_e(he(n,et(i),Ne(([f,{offsetTop:p}])=>({...f,top:f.top+p}))),s),{customScrollParent:d,useWindowScroll:c,windowScrollContainerState:l,windowScrollTo:s,windowViewportRect:i}},zt(En)),_j=mt(([{sizeRanges:e,sizes:n},{headerHeight:l,scrollTop:i},{initialTopMostItemIndex:s},{didMount:c},{useWindowScroll:d,windowScrollContainerState:f,windowViewportRect:p}])=>{const m=ct(),x=ye(void 0),b=ye(null),y=ye(null);return _e(f,b),_e(p,y),ht(he(m,et(n,i,d,b,y,l)),([v,w,N,j,k,T,C])=>{const L=pj(w.sizeTree);j&&k!==null&&T!==null&&(N=k.scrollTop-T.offsetTop),N-=C,v({ranges:L,scrollTop:N})}),_e(he(x,Fe(xm),Ne(Rj)),s),_e(he(c,et(x),Fe(([,v])=>v!==void 0),Mt(),Ne(([,v])=>v.ranges)),e),{getState:m,restoreStateFrom:x}},zt(Nr,En,Is,_l,Nm));function Rj(e){return{align:"start",index:0,offset:e.scrollTop}}const Mj=mt(([{topItemsIndexes:e}])=>{const n=ye(0);return _e(he(n,Fe(l=>l>=0),Ne(l=>Array.from({length:l}).map((i,s)=>s))),e),{topItemCount:n}},zt(oi));function ov(e){let n=!1,l;return(()=>(n||(n=!0,l=e()),l))}const zj=ov(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Dj=mt(([{deviation:e,scrollBy:n,scrollingInProgress:l,scrollTop:i},{isAtBottom:s,isScrolling:c,lastJumpDueToItemResize:d,scrollDirection:f},{listState:p},{beforeUnshiftWith:m,gap:x,shiftWithOffset:b,sizes:y},{log:v},{recalcInProgress:w}])=>{const N=Zn(he(p,et(d),jr(([,k,T,C],[{bottom:L,items:G,offsetBottom:I,totalCount:R},X])=>{const U=L+I;let D=0;return T===R&&k.length>0&&G.length>0&&(G[0].originalIndex===0&&k[0].originalIndex===0||(D=U-C,D!==0&&(D+=X))),[D,G,R,U]},[0,[],0,0]),Fe(([k])=>k!==0),et(i,f,l,s,v,w),Fe(([,k,T,C,,,L])=>!L&&!C&&k!==0&&T===Ns),Ne(([[k],,,,,T])=>(T("Upward scrolling compensation",{amount:k},ln.DEBUG),k))));function j(k){k>0?(We(n,{behavior:"auto",top:-k}),We(e,0)):(We(e,0),We(n,{behavior:"auto",top:-k}))}return ht(he(N,et(e,c)),([k,T,C])=>{C&&zj()?We(e,T-k):j(-k)}),ht(he(Wt(vn(c,!1),e,w),Fe(([k,T,C])=>!k&&!C&&T!==0),Ne(([k,T])=>T),Qr(1)),j),_e(he(b,Ne(k=>({top:-k}))),n),ht(he(m,et(y,x),Ne(([k,{groupIndices:T,lastSize:C,sizeTree:L},G])=>{function I(Q){return Q*(C+G)}if(T.length===0)return I(k);let R=0;const X=ws(L,0);let U=0,D=0;for(;U<k;){U++,R+=X;let Q=T.length===D+1?1/0:T[D+1]-T[D]-1;U+Q>k&&(R-=X,Q=k-U+1),U+=Q,R+=I(Q),D++}return R})),k=>{We(e,k),requestAnimationFrame(()=>{We(n,{top:k}),requestAnimationFrame(()=>{We(e,0),We(w,!1)})})}),{deviation:e}},zt(En,Bs,oi,Nr,Ol,vm)),Lj=mt(([e,n,l,i,s,c,d,f,p,m,x])=>({...e,...n,...l,...i,...s,...c,...d,...f,...p,...m,...x}),zt(jm,Aj,_l,sv,lv,Oj,Nj,Nm,av,Ol,iv)),cv=mt(([{data:e,defaultItemSize:n,firstItemIndex:l,fixedItemSize:i,fixedGroupSize:s,gap:c,groupIndices:d,heightEstimates:f,itemSize:p,sizeRanges:m,sizes:x,statefulTotalCount:b,totalCount:y,trackItemSizes:v},{initialItemFinalLocationReached:w,initialTopMostItemIndex:N,scrolledToInitialItem:j},k,T,C,L,{scrollToIndex:G},I,{topItemCount:R},{groupCounts:X},U])=>{const{listState:D,minOverscanItemCount:Q,topItemsIndexes:M,rangeChanged:V,...H}=L;return _e(V,U.scrollSeekRangeChanged),_e(he(U.windowViewportRect,Ne(q=>q.visibleHeight)),k.viewportHeight),{data:e,defaultItemHeight:n,firstItemIndex:l,fixedItemHeight:i,fixedGroupHeight:s,gap:c,groupCounts:X,heightEstimates:f,initialItemFinalLocationReached:w,initialTopMostItemIndex:N,scrolledToInitialItem:j,sizeRanges:m,topItemCount:R,topItemsIndexes:M,totalCount:y,...C,groupIndices:d,itemSize:p,listState:D,minOverscanItemCount:Q,scrollToIndex:G,statefulTotalCount:b,trackItemSizes:v,rangeChanged:V,...H,...U,...k,sizes:x,...T}},zt(Nr,Is,En,_j,Tj,oi,Ls,Dj,Mj,ev,Lj));function Ij(e,n){const l={},i={};let s=0;const c=e.length;for(;s<c;)i[e[s]]=1,s+=1;for(const d in n)Object.hasOwn(i,d)||(l[d]=n[d]);return l}const rc=typeof document<"u"?ke.useLayoutEffect:ke.useEffect;function uv(e,n,l){const i=Object.keys(n.required||{}),s=Object.keys(n.optional||{}),c=Object.keys(n.methods||{}),d=Object.keys(n.events||{}),f=ke.createContext({});function p(j,k){j.propsReady!==void 0&&We(j.propsReady,!1);for(const T of i){const C=j[n.required[T]];We(C,k[T])}for(const T of s)if(T in k){const C=j[n.optional[T]];We(C,k[T])}j.propsReady!==void 0&&We(j.propsReady,!0)}function m(j){return c.reduce((k,T)=>(k[T]=C=>{const L=j[n.methods[T]];We(L,C)},k),{})}function x(j){return d.reduce((k,T)=>(k[T]=Jk(j[n.events[T]]),k),{})}const b=ke.forwardRef(function(j,k){const{children:T,...C}=j,[L]=ke.useState(()=>Ac(tj(e),R=>{p(R,C)})),[G]=ke.useState(Bb(x,L));rc(()=>{for(const R of d)R in C&&ht(G[R],C[R]);return()=>{Object.values(G).map(bm)}},[C,G,L]),rc(()=>{p(L,C)}),ke.useImperativeHandle(k,Ib(m(L)));const I=l;return u.jsx(f.Provider,{value:L,children:l!==void 0?u.jsx(I,{...Ij([...i,...s,...d],C),children:T}):T})}),y=j=>{const k=ke.useContext(f);return ke.useCallback(T=>{We(k[j],T)},[k,j])},v=j=>{const k=ke.useContext(f)[j],T=ke.useCallback(C=>ht(k,C),[k]);return ke.useSyncExternalStore(T,()=>It(k),()=>It(k))},w=j=>{const k=ke.useContext(f)[j],[T,C]=ke.useState(Bb(It,k));return rc(()=>ht(k,L=>{L!==T&&C(Ib(L))}),[k,T]),T},N=ke.version.startsWith("18")?v:w;return{Component:b,useEmitter:(j,k)=>{const T=ke.useContext(f)[j];rc(()=>ht(T,k),[k,T])},useEmitterValue:N,usePublisher:y}}const dv=ke.createContext(void 0),fv=ke.createContext(void 0),xf="-webkit-sticky",Qb="sticky",Cm=ov(()=>{if(typeof document>"u")return Qb;const e=document.createElement("div");return e.style.position=xf,e.style.position===xf?xf:Qb}),mv=typeof document<"u"?ke.useLayoutEffect:ke.useEffect;function bf(e){return"self"in e}function Bj(e){return"body"in e}function pv(e,n,l,i=da,s,c){const d=ke.useRef(null),f=ke.useRef(null),p=ke.useRef(null),m=ke.useCallback(y=>{let v,w,N;const j=y.target;if(Bj(j)||bf(j)){const T=bf(j)?j:j.defaultView;N=c===!0?T.scrollX:T.scrollY,v=c===!0?T.document.documentElement.scrollWidth:T.document.documentElement.scrollHeight,w=c===!0?T.innerWidth:T.innerHeight}else N=c===!0?j.scrollLeft:j.scrollTop,v=c===!0?j.scrollWidth:j.scrollHeight,w=c===!0?j.offsetWidth:j.offsetHeight;const k=()=>{e({scrollHeight:v,scrollTop:Math.max(N,0),viewportHeight:w})};y.suppressFlushSync===!0?k():gk.flushSync(k),f.current!==null&&(N===f.current||N<=0||N===v-w)&&(f.current=null,n(!0),p.current&&(clearTimeout(p.current),p.current=null))},[e,n,c]);ke.useEffect(()=>{const y=s||d.current;return i(s||d.current),m({suppressFlushSync:!0,target:y}),y.addEventListener("scroll",m,{passive:!0}),()=>{i(null),y.removeEventListener("scroll",m)}},[d,m,l,i,s]);function x(y){const v=d.current;if(!v||(c===!0?"offsetWidth"in v&&v.offsetWidth===0:"offsetHeight"in v&&v.offsetHeight===0))return;const w=y.behavior==="smooth";let N,j,k;bf(v)?(j=Math.max(Tl(v.document.documentElement,c===!0?"width":"height"),c===!0?v.document.documentElement.scrollWidth:v.document.documentElement.scrollHeight),N=c===!0?v.innerWidth:v.innerHeight,k=c===!0?window.scrollX:window.scrollY):(j=v[c===!0?"scrollWidth":"scrollHeight"],N=Tl(v,c===!0?"width":"height"),k=v[c===!0?"scrollLeft":"scrollTop"]);const T=j-N;if(y.top=Math.ceil(Math.max(Math.min(T,y.top),0)),nv(N,j)||y.top===k){e({scrollHeight:j,scrollTop:k,viewportHeight:N}),w&&n(!0);return}w?(f.current=y.top,p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{p.current=null,f.current=null,n(!0)},1e3)):f.current=null,c===!0&&(y={...y.behavior!==void 0?{behavior:y.behavior}:{},left:y.top}),v.scrollTo(y)}function b(y){c===!0&&(y={...y.behavior!==void 0?{behavior:y.behavior}:{},...y.top!==void 0?{left:y.top}:{}}),d.current.scrollBy(y)}return{scrollByCallback:b,scrollerRef:d,scrollToCallback:x}}function Em(e){return e}const Hj=mt(()=>{const e=ye(f=>`Item ${f}`),n=ye(f=>`Group ${f}`),l=ye({}),i=ye(Em),s=ye("div"),c=ye(da),d=(f,p=null)=>vn(he(l,Ne(m=>m[f]),Mt()),p);return{components:l,computeItemKey:i,EmptyPlaceholder:d("EmptyPlaceholder"),FooterComponent:d("Footer"),GroupComponent:d("Group","div"),groupContent:n,HeaderComponent:d("Header"),HeaderFooterTag:s,ItemComponent:d("Item","div"),itemContent:e,ListComponent:d("List","div"),ScrollerComponent:d("Scroller","div"),scrollerRef:c,ScrollSeekPlaceholder:d("ScrollSeekPlaceholder"),TopItemListComponent:d("TopItemList")}}),Uj=mt(([e,n])=>({...e,...n}),zt(cv,Hj)),Fj=({height:e})=>u.jsx("div",{style:{height:e}}),$j={overflowAnchor:"none",position:Cm(),zIndex:1},hv={overflowAnchor:"none"},Gj={...hv,display:"inline-block",height:"100%"},Zb=ke.memo(function({showTopList:e=!1}){const n=Ye("listState"),l=cr("sizeRanges"),i=Ye("useWindowScroll"),s=Ye("customScrollParent"),c=cr("windowScrollContainerState"),d=cr("scrollContainerState"),f=s||i?c:d,p=Ye("itemContent"),m=Ye("context"),x=Ye("groupContent"),b=Ye("trackItemSizes"),y=Ye("itemSize"),v=Ye("log"),w=cr("gap"),N=Ye("horizontalDirection"),{callbackRef:j}=lj(l,y,b,e?da:f,v,w,s,N,Ye("skipAnimationFrameInResizeObserver")),[k,T]=ke.useState(0);Tm("deviation",H=>{k!==H&&T(H)});const C=Ye("EmptyPlaceholder"),L=Ye("ScrollSeekPlaceholder")??Fj,G=Ye("ListComponent"),I=Ye("ItemComponent"),R=Ye("GroupComponent"),X=Ye("computeItemKey"),U=Ye("isSeeking"),D=Ye("groupIndices").length>0,Q=Ye("alignToBottom"),M=Ye("initialItemFinalLocationReached"),V=e?{}:{boxSizing:"border-box",...N?{display:"inline-block",height:"100%",marginLeft:k!==0?k:Q?"auto":0,paddingLeft:n.offsetTop,paddingRight:n.offsetBottom,whiteSpace:"nowrap"}:{marginTop:k!==0?k:Q?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...M?{}:{visibility:"hidden"}};return!e&&n.totalCount===0&&C!==null&&C!==void 0?u.jsx(C,{...yn(C,m)}):u.jsx(G,{...yn(G,m),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:j,style:V,children:(e?n.topItems:n.items).map(H=>{const q=H.originalIndex,B=X(q+n.firstItemIndex,H.data,m);return U?_.createElement(L,{...yn(L,m),height:H.size,index:H.index,key:B,type:H.type||"item",...H.type==="group"?{}:{groupIndex:H.groupIndex}}):H.type==="group"?_.createElement(R,{...yn(R,m),"data-index":q,"data-item-index":H.index,"data-known-size":H.size,key:B,style:$j},x(H.index,m)):_.createElement(I,{...yn(I,m),...Xj(I,H.data),"data-index":q,"data-item-group-index":H.groupIndex,"data-item-index":H.index,"data-known-size":H.size,key:B,style:N?Gj:hv},D?p(H.index,H.groupIndex,H.data,m):p(H.index,H.data,m))})})}),qj={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Vj={outline:"none",overflowX:"auto",position:"relative"},_c=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),Yj={position:Cm(),top:0,width:"100%",zIndex:1};function yn(e,n){if(typeof e!="string")return{context:n}}function Xj(e,n){return{item:typeof e=="string"?void 0:n}}const Pj=ke.memo(function(){const e=Ye("HeaderComponent"),n=cr("headerHeight"),l=Ye("HeaderFooterTag"),i=si(ke.useMemo(()=>c=>{n(Tl(c,"height"))},[n]),!0,Ye("skipAnimationFrameInResizeObserver")),s=Ye("context");return e!=null?u.jsx(l,{ref:i,children:u.jsx(e,{...yn(e,s)})}):null}),Qj=ke.memo(function(){const e=Ye("FooterComponent"),n=cr("footerHeight"),l=Ye("HeaderFooterTag"),i=si(ke.useMemo(()=>c=>{n(Tl(c,"height"))},[n]),!0,Ye("skipAnimationFrameInResizeObserver")),s=Ye("context");return e!=null?u.jsx(l,{ref:i,children:u.jsx(e,{...yn(e,s)})}):null});function gv({useEmitter:e,useEmitterValue:n,usePublisher:l}){return ke.memo(function({children:i,style:s,context:c,...d}){const f=l("scrollContainerState"),p=n("ScrollerComponent"),m=l("smoothScrollTargetReached"),x=n("scrollerRef"),b=n("horizontalDirection")||!1,{scrollByCallback:y,scrollerRef:v,scrollToCallback:w}=pv(f,m,p,x,void 0,b);return e("scrollTo",w),e("scrollBy",y),u.jsx(p,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:v,style:{...b?Vj:qj,...s},tabIndex:0,...d,...yn(p,c),children:i})})}function xv({useEmitter:e,useEmitterValue:n,usePublisher:l}){return ke.memo(function({children:i,style:s,context:c,...d}){const f=l("windowScrollContainerState"),p=n("ScrollerComponent"),m=l("smoothScrollTargetReached"),x=n("totalListHeight"),b=n("deviation"),y=n("customScrollParent"),v=ke.useRef(null),w=n("scrollerRef"),{scrollByCallback:N,scrollerRef:j,scrollToCallback:k}=pv(f,m,p,w,y);return mv(()=>{var T;return j.current=y||((T=v.current)==null?void 0:T.ownerDocument.defaultView),()=>{j.current=null}},[j,y]),e("windowScrollTo",k),e("scrollBy",N),u.jsx(p,{ref:v,"data-virtuoso-scroller":!0,style:{position:"relative",...s,...x!==0?{height:x+b}:void 0},...d,...yn(p,c),children:i})})}const Zj=({children:e})=>{const n=ke.useContext(dv),l=cr("viewportHeight"),i=cr("fixedItemHeight"),s=Ye("alignToBottom"),c=Ye("horizontalDirection"),d=ke.useMemo(()=>$0(l,p=>Tl(p,c?"width":"height")),[l,c]),f=si(d,!0,Ye("skipAnimationFrameInResizeObserver"));return ke.useEffect(()=>{n&&(l(n.viewportHeight),i(n.itemHeight))},[n,l,i]),u.jsx("div",{"data-viewport-type":"element",ref:f,style:_c(s),children:e})},Kj=({children:e})=>{const n=ke.useContext(dv),l=cr("windowViewportRect"),i=cr("fixedItemHeight"),s=Ye("customScrollParent"),c=q0(l,s,Ye("skipAnimationFrameInResizeObserver")),d=Ye("alignToBottom");return ke.useEffect(()=>{n&&(i(n.itemHeight),l({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))},[n,l,i]),u.jsx("div",{"data-viewport-type":"window",ref:c,style:_c(d),children:e})},Wj=({children:e})=>{const n=Ye("TopItemListComponent")??"div",l=Ye("headerHeight"),i={...Yj,marginTop:`${l}px`},s=Ye("context");return u.jsx(n,{style:i,...yn(n,s),children:e})},Jj=ke.memo(function(e){const n=Ye("useWindowScroll"),l=Ye("topItemsIndexes").length>0,i=Ye("customScrollParent"),s=Ye("context");return u.jsxs(i||n?nN:tN,{...e,context:s,children:[l&&u.jsx(Wj,{children:u.jsx(Zb,{showTopList:!0})}),u.jsxs(i||n?Kj:Zj,{children:[u.jsx(Pj,{}),u.jsx(Zb,{}),u.jsx(Qj,{})]})]})}),{Component:eN,useEmitter:Tm,useEmitterValue:Ye,usePublisher:cr}=uv(Uj,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Jj),tN=gv({useEmitter:Tm,useEmitterValue:Ye,usePublisher:cr}),nN=xv({useEmitter:Tm,useEmitterValue:Ye,usePublisher:cr}),rN=eN,lN=mt(()=>{const e=ye(m=>u.jsxs("td",{children:["Item $",m]})),n=ye(null),l=ye(m=>u.jsxs("td",{colSpan:1e3,children:["Group ",m]})),i=ye(null),s=ye(null),c=ye({}),d=ye(Em),f=ye(da),p=(m,x=null)=>vn(he(c,Ne(b=>b[m]),Mt()),x);return{components:c,computeItemKey:d,context:n,EmptyPlaceholder:p("EmptyPlaceholder"),FillerRow:p("FillerRow"),fixedFooterContent:s,fixedHeaderContent:i,itemContent:e,groupContent:l,ScrollerComponent:p("Scroller","div"),scrollerRef:f,ScrollSeekPlaceholder:p("ScrollSeekPlaceholder"),TableBodyComponent:p("TableBody","tbody"),TableComponent:p("Table","table"),TableFooterComponent:p("TableFoot","tfoot"),TableHeadComponent:p("TableHead","thead"),TableRowComponent:p("TableRow","tr"),GroupComponent:p("Group","tr")}});zt(cv,lN);Cm();const Kb={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},iN={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Wb,floor:yc,max:gs,min:yf,round:Jb}=Math;function ey(e,n,l){return Array.from({length:n-e+1}).map((i,s)=>({data:l===null?null:l[s+e],index:s+e}))}function aN(e){return{...iN,items:e}}function lc(e,n){return e!==void 0&&e.width===n.width&&e.height===n.height}function sN(e,n){return e!==void 0&&e.column===n.column&&e.row===n.row}const oN=mt(([{increaseViewportBy:e,listBoundary:n,overscan:l,visibleRange:i},{footerHeight:s,headerHeight:c,scrollBy:d,scrollContainerState:f,scrollTo:p,scrollTop:m,smoothScrollTargetReached:x,viewportHeight:b},y,v,{didMount:w,propsReady:N},{customScrollParent:j,useWindowScroll:k,windowScrollContainerState:T,windowScrollTo:C,windowViewportRect:L},G])=>{const I=ye(0),R=ye(0),X=ye(Kb),U=ye({height:0,width:0}),D=ye({height:0,width:0}),Q=ct(),M=ct(),V=ye(0),H=ye(null),q=ye({column:0,row:0}),B=ct(),P=ct(),oe=ye(!1),ae=ye(0),A=ye(!0),z=ye(!1),W=ye(!1);ht(he(w,et(ae),Fe(([le,xe])=>xe!==0)),()=>{We(A,!1)}),ht(he(Wt(w,A,D,U,ae,z),Fe(([le,xe,Te,je,,He])=>le&&!xe&&Te.height!==0&&je.height!==0&&!He)),([,,,,le])=>{We(z,!0),wm(1,()=>{We(Q,le)}),hr(he(m),()=>{We(n,[0,0]),We(A,!0)})}),_e(he(P,Fe(le=>le!=null&&le.scrollTop>0),kr(0)),R),ht(he(w,et(P),Fe(([,le])=>le!=null)),([,le])=>{le&&(We(U,le.viewport),We(D,le.item),We(q,le.gap),le.scrollTop>0&&(We(oe,!0),hr(he(m,ii(1)),xe=>{We(oe,!1)}),We(p,{top:le.scrollTop})))}),_e(he(U,Ne(({height:le})=>le)),b),_e(he(Wt(Ue(U,lc),Ue(D,lc),Ue(q,(le,xe)=>le!==void 0&&le.column===xe.column&&le.row===xe.row),Ue(m)),Ne(([le,xe,Te,je])=>({gap:Te,item:xe,scrollTop:je,viewport:le}))),B),_e(he(Wt(Ue(I),i,Ue(q,sN),Ue(D,lc),Ue(U,lc),Ue(H),Ue(R),Ue(oe),Ue(A),Ue(ae)),Fe(([,,,,,,,le])=>!le),Ne(([le,[xe,Te],je,He,fe,Ce,Re,,$e,Je])=>{const{column:Ge,row:vt}=je,{height:Tt,width:Gt}=He,{width:en}=fe;if(Re===0&&(le===0||en===0))return Kb;if(Gt===0){const De=km(Je,le),Xe=De+Math.max(Re-1,0);return aN(ey(De,Xe,Ce))}const At=bv(en,Gt,Ge);let Ot,kn;$e?xe===0&&Te===0&&Re>0?(Ot=0,kn=Re-1):(Ot=At*yc((xe+vt)/(Tt+vt)),kn=At*Wb((Te+vt)/(Tt+vt))-1,kn=yf(le-1,gs(kn,At-1)),Ot=yf(kn,gs(0,Ot))):(Ot=0,kn=-1);const ce=ey(Ot,kn,Ce),{bottom:ve,top:Me}=ty(fe,je,He,ce),K=Wb(le/At),Se=K*Tt+(K-1)*vt-ve;return{bottom:ve,itemHeight:Tt,items:ce,itemWidth:Gt,offsetBottom:Se,offsetTop:Me,top:Me}})),X),_e(he(H,Fe(le=>le!==null),Ne(le=>le.length)),I),_e(he(Wt(U,D,X,q),Fe(([le,xe,{items:Te}])=>Te.length>0&&xe.height!==0&&le.height!==0),Ne(([le,xe,{items:Te},je])=>{const{bottom:He,top:fe}=ty(le,je,xe,Te);return[fe,He]}),Mt(ks)),n);const O=ye(!1);_e(he(m,et(O),Ne(([le,xe])=>xe||le!==0)),O);const $=Zn(he(Wt(X,I),Fe(([{items:le}])=>le.length>0),et(O),Fe(([[le,xe],Te])=>{const je=le.items[le.items.length-1].index===xe-1;return(Te||le.bottom>0&&le.itemHeight>0&&le.offsetBottom===0&&le.items.length===xe)&&je}),Ne(([[,le]])=>le-1),Mt())),ee=Zn(he(Ue(X),Fe(({items:le})=>le.length>0&&le[0].index===0),kr(0),Mt())),re=Zn(he(Ue(X),et(oe),Fe(([{items:le},xe])=>le.length>0&&!xe),Ne(([{items:le}])=>({endIndex:le[le.length-1].index,startIndex:le[0].index})),Mt(Z0),Qr(0)));_e(re,v.scrollSeekRangeChanged),_e(he(Q,et(U,D,I,q),Ne(([le,xe,Te,je,He])=>{const fe=tv(le),{align:Ce,behavior:Re,offset:$e}=fe;let Je=fe.index;Je==="LAST"&&(Je=je-1),Je=gs(0,Je,yf(je-1,Je));let Ge=Pf(xe,He,Te,Je);return Ce==="end"?Ge=Jb(Ge-xe.height+Te.height):Ce==="center"&&(Ge=Jb(Ge-xe.height/2+Te.height/2)),$e!==void 0&&$e!==0&&(Ge+=$e),{behavior:Re,top:Ge}})),p);const Y=vn(he(X,Ne(le=>le.offsetBottom+le.bottom)),0);return _e(he(L,Ne(le=>({height:le.visibleHeight,width:le.visibleWidth}))),U),{customScrollParent:j,data:H,deviation:V,footerHeight:s,gap:q,headerHeight:c,increaseViewportBy:e,initialItemCount:R,itemDimensions:D,overscan:l,restoreStateFrom:P,scrollBy:d,scrollContainerState:f,scrollHeight:M,scrollTo:p,scrollToIndex:Q,scrollTop:m,smoothScrollTargetReached:x,totalCount:I,useWindowScroll:k,viewportDimensions:U,windowScrollContainerState:T,windowScrollTo:C,windowViewportRect:L,...v,gridState:X,horizontalDirection:W,initialTopMostItemIndex:ae,totalListHeight:Y,...y,endReached:$,propsReady:N,rangeChanged:re,startReached:ee,stateChanged:B,stateRestoreInProgress:oe,...G}},zt(jm,En,Bs,sv,_l,Nm,Ol));function bv(e,n,l){return gs(1,yc((e+l)/(yc(n)+l)))}function ty(e,n,l,i){const{height:s}=l;if(s===void 0||i.length===0)return{bottom:0,top:0};const c=Pf(e,n,l,i[0].index);return{bottom:Pf(e,n,l,i[i.length-1].index)+s,top:c}}function Pf(e,n,l,i){const s=bv(e.width,l.width,n.column),c=yc(i/s),d=c*l.height+gs(0,c-1)*n.row;return d>0?d+n.row:d}const cN=mt(()=>{const e=ye(b=>`Item ${b}`),n=ye({}),l=ye(null),i=ye("virtuoso-grid-item"),s=ye("virtuoso-grid-list"),c=ye(Em),d=ye("div"),f=ye(da),p=(b,y=null)=>vn(he(n,Ne(v=>v[b]),Mt()),y),m=ye(!1),x=ye(!1);return _e(Ue(x),m),{components:n,computeItemKey:c,context:l,FooterComponent:p("Footer"),HeaderComponent:p("Header"),headerFooterTag:d,itemClassName:i,ItemComponent:p("Item","div"),itemContent:e,listClassName:s,ListComponent:p("List","div"),readyStateChanged:m,reportReadyState:x,ScrollerComponent:p("Scroller","div"),scrollerRef:f,ScrollSeekPlaceholder:p("ScrollSeekPlaceholder","div")}}),uN=mt(([e,n])=>({...e,...n}),zt(oN,cN)),dN=ke.memo(function(){const e=Lt("gridState"),n=Lt("listClassName"),l=Lt("itemClassName"),i=Lt("itemContent"),s=Lt("computeItemKey"),c=Lt("isSeeking"),d=ur("scrollHeight"),f=Lt("ItemComponent"),p=Lt("ListComponent"),m=Lt("ScrollSeekPlaceholder"),x=Lt("context"),b=ur("itemDimensions"),y=ur("gap"),v=Lt("log"),w=Lt("stateRestoreInProgress"),N=ur("reportReadyState"),j=si(ke.useMemo(()=>k=>{const T=k.parentElement.parentElement.scrollHeight;d(T);const C=k.firstChild;if(C!==null){const{height:L,width:G}=C.getBoundingClientRect();b({height:L,width:G})}y({column:ny("column-gap",getComputedStyle(k).columnGap,v),row:ny("row-gap",getComputedStyle(k).rowGap,v)})},[d,b,y,v]),!0,!1);return mv(()=>{e.itemHeight>0&&e.itemWidth>0&&N(!0)},[e]),w?null:u.jsx(p,{className:n,ref:j,...yn(p,x),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(k=>{const T=s(k.index,k.data,x);return c?u.jsx(m,{...yn(m,x),height:e.itemHeight,index:k.index,width:e.itemWidth},T):_.createElement(f,{...yn(f,x),className:l,"data-index":k.index,key:T},i(k.index,k.data,x))})})}),fN=ke.memo(function(){const e=Lt("HeaderComponent"),n=ur("headerHeight"),l=Lt("headerFooterTag"),i=si(ke.useMemo(()=>c=>{n(Tl(c,"height"))},[n]),!0,!1),s=Lt("context");return e!=null?u.jsx(l,{ref:i,children:u.jsx(e,{...yn(e,s)})}):null}),mN=ke.memo(function(){const e=Lt("FooterComponent"),n=ur("footerHeight"),l=Lt("headerFooterTag"),i=si(ke.useMemo(()=>c=>{n(Tl(c,"height"))},[n]),!0,!1),s=Lt("context");return e!=null?u.jsx(l,{ref:i,children:u.jsx(e,{...yn(e,s)})}):null}),pN=({children:e})=>{const n=ke.useContext(fv),l=ur("itemDimensions"),i=ur("viewportDimensions"),s=si(ke.useMemo(()=>c=>{i(c.getBoundingClientRect())},[i]),!0,!1);return ke.useEffect(()=>{n&&(i({height:n.viewportHeight,width:n.viewportWidth}),l({height:n.itemHeight,width:n.itemWidth}))},[n,i,l]),u.jsx("div",{ref:s,style:_c(!1),children:e})},hN=({children:e})=>{const n=ke.useContext(fv),l=ur("windowViewportRect"),i=ur("itemDimensions"),s=Lt("customScrollParent"),c=q0(l,s,!1);return ke.useEffect(()=>{n&&(i({height:n.itemHeight,width:n.itemWidth}),l({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:n.viewportWidth}))},[n,l,i]),u.jsx("div",{ref:c,style:_c(!1),children:e})},gN=ke.memo(function({...e}){const n=Lt("useWindowScroll"),l=Lt("customScrollParent"),i=l||n?bN:xN,s=l||n?hN:pN,c=Lt("context");return u.jsx(i,{...e,...yn(i,c),children:u.jsxs(s,{children:[u.jsx(fN,{}),u.jsx(dN,{}),u.jsx(mN,{})]})})}),{useEmitter:yv,useEmitterValue:Lt,usePublisher:ur}=uv(uN,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},gN),xN=gv({useEmitter:yv,useEmitterValue:Lt,usePublisher:ur}),bN=xv({useEmitter:yv,useEmitterValue:Lt,usePublisher:ur});function ny(e,n,l){return n!=="normal"&&(n==null?void 0:n.endsWith("px"))!==!0&&l(`${e} was not resolved to pixel value correctly`,n,ln.WARN),n==="normal"?0:parseInt(n??"0",10)}const os=e=>Math.round(e*10)/10;function Qf(e){return{providerId:e.providerId,providerName:e.providerName,backend:e.backend,model:e.model}}function yN(e){return`${e.providerId}::${e.model}`}function vN(e){return`${e.providerName} > ${e.model}`}function ry(e){let n=0,l=0,i=0,s=0,c=0,d=0;const f=[],p=[];let m=0;for(const[y,v]of e.entries()){const w=v.stats,N=Qf(w);n+=w.totalTime,l+=w.toolTime,i+=w.prefillTokens,s+=w.generationTokens;const j=w.prefillSpeed>0?w.prefillTokens/w.prefillSpeed:0,k=w.generationSpeed>0?w.generationTokens/w.generationSpeed:0;c+=j,d+=k,f.push({messageId:v.id,timestamp:v.timestamp,...N,mode:w.mode,responseIndex:y+1,prefillTokens:w.prefillTokens,generationTokens:w.generationTokens,prefillSpeed:w.prefillSpeed,generationSpeed:w.generationSpeed,totalTime:w.totalTime,aiTime:w.totalTime-w.toolTime,toolTime:w.toolTime});const T=w.llmCalls??[];for(const C of T)m+=1,p.push({messageId:v.id,timestamp:C.timestamp??v.timestamp,providerId:C.providerId,providerName:C.providerName,backend:C.backend,model:C.model,mode:w.mode,responseIndex:y+1,sessionCallIndex:m,callIndex:C.callIndex,promptTokens:C.promptTokens,completionTokens:C.completionTokens,ttft:C.ttft,completionTime:C.completionTime,prefillSpeed:C.prefillSpeed,generationSpeed:C.generationSpeed,totalTime:C.totalTime})}const x=c>0?os(i/c):0,b=d>0?os(s/d):0;return{totalTime:os(n),aiTime:os(n-l),toolTime:os(l),prefillTokens:i,generationTokens:s,avgPrefillSpeed:x,avgGenerationSpeed:b,responseCount:e.length,llmCallCount:p.length,dataPoints:f,callDataPoints:p}}function SN(e){const n=e.filter(s=>s.stats!==void 0&&s.stats!==null).sort((s,c)=>new Date(s.timestamp).getTime()-new Date(c.timestamp).getTime());if(n.length===0)return null;const l=new Map;for(const s of n){const c=yN(Qf(s.stats)),d=l.get(c)??[];l.set(c,[...d,s])}const i=Array.from(l.entries()).map(([s,c])=>{const d=Qf(c[0].stats),f=ry(c);return{...d,key:s,label:vN(d),...f}});return{...ry(n),modelGroups:i}}function wN(e){return _.useMemo(()=>SN(e),[e])}function kN(e){const[n,l]=_.useState(null),[i,s]=_.useState(!0),[c,d]=_.useState(null),f=e||"";return _.useEffect(()=>{if(!f){s(!1);return}let p=!0,m=null;const x=async()=>{try{const y=await(await fetch(`/api/branch?workdir=${encodeURIComponent(f)}`)).json();p&&(l(y.branch),d(y.error||null),s(!1))}catch(b){p&&(d(b instanceof Error?b.message:"Failed to fetch branch"),s(!1))}};return x(),m=setInterval(x,3e3),()=>{p=!1,m&&clearInterval(m)}},[f]),{branch:n,loading:i,error:c}}function ly(e){return e.toLocaleString("en-US").replace(/,/g," ")}function iy(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toFixed(1)}function jN(e){if(e<60)return`${e.toFixed(1)}s`;const n=Math.floor(e/60),l=Math.round(e%60);return`${n}m${l}s`}const NN="modulepreload",CN=function(e){return"/"+e},ay={},EN=function(n,l,i){let s=Promise.resolve();if(l&&l.length>0){let d=function(m){return Promise.all(m.map(x=>Promise.resolve(x).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),p=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));s=d(l.map(m=>{if(m=CN(m),m in ay)return;ay[m]=!0;const x=m.endsWith(".css"),b=x?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${b}`))return;const y=document.createElement("link");if(y.rel=x?"stylesheet":NN,x||(y.as="script"),y.crossOrigin="",y.href=m,p&&y.setAttribute("nonce",p),document.head.appendChild(y),x)return new Promise((v,w)=>{y.addEventListener("load",v),y.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return s.then(d=>{for(const f of d||[])f.status==="rejected"&&c(f.reason);return n().catch(c)})},sy=["▁","▂","▃","▄","▅","▆","▇","█"];function TN(e,n,l){if(l===n)return 4;const i=(e-n)/(l-n);return Math.min(7,Math.max(0,Math.round(i*7)))}function AN(e,n){if(e===n){const s=Math.max(Math.abs(e)*.05,1);return{minY:e-s,maxY:n+s}}const l=n-e,i=Math.max(l*.1,.1);return{minY:e-i,maxY:n+i}}function ON(e,n){if(e.length===0||n<=0)return{blocks:"",minX:0,maxX:0,minY:0,maxY:0};const l=[...e].sort((b,y)=>b.x-y.x),i=l[0].x,s=l[l.length-1].x,c=Math.min(...l.map(b=>b.y)),d=Math.max(...l.map(b=>b.y)),{minY:f,maxY:p}=AN(c,d),m=Array.from({length:n},()=>" "),x=new Map;for(const b of l){const y=s===i?0:Math.round((b.x-i)/(s-i)*(n-1)),v=x.get(y)??[];x.set(y,[...v,b.y])}for(const[b,y]of x){const v=Math.max(...y);m[b]=sy[TN(v,f,p)]??sy[0]}return{blocks:m.join(""),minX:i,maxX:s,minY:f,maxY:p}}function oy(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toFixed(1)}function cy({data:e,width:n=60,height:l=78,label:i,xLabel:s,yLabel:c,showAxes:d=!0,formatY:f=oy,formatX:p=oy}){const m=_.useMemo(()=>{const x=ON(e,n),b=Math.max(n*6,240),y=10,v=8,N=[...e].sort((C,L)=>C.x-L.x).map(C=>{const L=x.maxX===x.minX?b/2:y+(C.x-x.minX)/(x.maxX-x.minX)*(b-y*2),G=x.maxY===x.minY?l/2:v+(x.maxY-C.y)/(x.maxY-x.minY)*(l-v*2);return{...C,cx:L,cy:G,leftPercent:L/b*100,topPercent:G/l*100}}),j=N.map((C,L)=>`${L===0?"M":"L"} ${C.cx.toFixed(1)} ${C.cy.toFixed(1)}`).join(" "),T=[x.maxY,(x.maxY+x.minY)/2,x.minY].map(C=>({value:C,y:x.maxY===x.minY?l/2:v+(x.maxY-C)/(x.maxY-x.minY)*(l-v*2)}));return{...x,chartWidth:b,points:N,path:j,gridLines:T}},[e,l,n]);return e.length===0?u.jsxs("div",{className:"font-mono text-text-muted text-xs",children:[i&&u.jsx("div",{className:"mb-1",children:i}),u.jsx("div",{children:"No data"})]}):u.jsxs("div",{className:"font-mono text-xs",children:[i&&u.jsx("div",{className:"text-text-secondary mb-2",children:i}),u.jsxs("div",{className:"flex gap-3",children:[d&&u.jsx("div",{className:"w-12 h-[78px] flex flex-col justify-between text-right text-text-muted",children:m.gridLines.map(x=>u.jsx("span",{children:f(x.value)},`${x.value}-${x.y}`))}),u.jsx("div",{className:"flex-1 min-w-0",children:u.jsxs("div",{className:"relative h-[78px]",children:[u.jsxs("svg",{viewBox:`0 0 ${m.chartWidth} ${l}`,className:"w-full h-[78px] overflow-visible",preserveAspectRatio:"none","aria-hidden":"true",children:[m.gridLines.map(x=>u.jsx("line",{x1:"0",x2:m.chartWidth,y1:x.y,y2:x.y,stroke:"currentColor",strokeDasharray:"3 4",className:"text-border/60"},`grid-${x.y}`)),m.points.map(x=>u.jsx("line",{x1:x.cx,x2:x.cx,y1:l-4,y2:x.cy,stroke:"currentColor",className:"text-border/40"},`guide-${x.cx}-${x.cy}`)),m.points.length>1&&u.jsx("path",{d:m.path,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-accent-primary/45"})]}),m.points.map(x=>u.jsx("div",{className:"absolute -translate-x-1/2 -translate-y-1/2",style:{left:`${x.leftPercent}%`,top:`${x.topPercent}%`},title:`${p(x.x)} -> ${f(x.y)}`,children:u.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-accent-primary/20 flex items-center justify-center",children:u.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-accent-primary"})})},`point-${x.x}-${x.y}`))]})})]}),d&&u.jsxs("div",{className:"flex items-start gap-3 text-text-muted mt-1",children:[u.jsx("span",{className:"w-12"}),u.jsxs("span",{className:"flex-1 flex justify-between",children:[u.jsx("span",{children:p(m.minX)}),u.jsx("span",{children:s}),u.jsx("span",{children:p(m.maxX)})]})]}),c&&d&&u.jsx("div",{className:"text-text-muted mt-1 text-center",children:c})]})}function _N({data:e,prefillLabel:n="Prefill Speed (tok/s) by Response",generationLabel:l="Generation Speed (tok/s) by Response",xLabel:i="response",width:s=60}){const c=e.map(f=>({x:f.x,y:f.ppSpeed})),d=e.map(f=>({x:f.x,y:f.tgSpeed}));return u.jsxs("div",{className:"space-y-5",children:[u.jsx(cy,{data:c,width:s,label:n,xLabel:i}),u.jsx(cy,{data:d,width:s,label:l,xLabel:i})]})}function RN(e){const n=new Map;for(const l of e.callDataPoints){const i=n.get(l.messageId)??[];n.set(l.messageId,[...i,l])}return e.dataPoints.map(l=>{const i=[...n.get(l.messageId)??[]].sort((s,c)=>s.callIndex-c.callIndex);return{...l,callCount:i.length,calls:i,isExpandable:i.length>1}})}function MN(e){return{mode:"responses",xLabel:"response",prefillLabel:"Prefill Speed (tok/s) by Response",generationLabel:"Generation Speed (tok/s) by Response",points:e.dataPoints.map(n=>({x:n.responseIndex,ppSpeed:n.prefillSpeed,tgSpeed:n.generationSpeed}))}}function zN(e){return{mode:"calls",xLabel:"context",prefillLabel:"Prefill Speed (tok/s) vs Context",generationLabel:"Generation Speed (tok/s) vs Context",points:e.callDataPoints.map(n=>({x:n.promptTokens,ppSpeed:n.prefillSpeed,tgSpeed:n.generationSpeed}))}}function DN(e){return e.callDataPoints.length>0?zN(e):MN(e)}function vf(e){if(e<60)return`${e.toFixed(1)}s`;const n=Math.floor(e/60),l=e%60;return`${n}m ${l.toFixed(0)}s`}function li(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toString()}function ps(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toFixed(1)}function LN(e){if(e.length===0)return"0 ctx";const n=Math.min(...e),l=Math.max(...e);return n===l?`${li(n)} ctx`:`${li(n)}-${li(l)} ctx`}function vc(e){return`${ps(e)} t/s`}function vv(e){try{return new Date(e).toLocaleTimeString("en-US",{hour12:!1})}catch{return e}}function IN(e){return{exportedAt:new Date().toISOString(),providerId:e.providerId,providerName:e.providerName,backend:e.backend,model:e.model,label:e.label,summary:{totalTime:e.totalTime,aiTime:e.aiTime,toolTime:e.toolTime,prefillTokens:e.prefillTokens,generationTokens:e.generationTokens,avgPrefillSpeed:e.avgPrefillSpeed,avgGenerationSpeed:e.avgGenerationSpeed,responseCount:e.responseCount,llmCallCount:e.llmCallCount},responses:e.dataPoints.map(n=>({responseIndex:n.responseIndex,timestamp:n.timestamp,mode:n.mode,prefillTokens:n.prefillTokens,generationTokens:n.generationTokens,prefillSpeed:n.prefillSpeed,generationSpeed:n.generationSpeed,totalTime:n.totalTime,aiTime:n.aiTime,toolTime:n.toolTime})),llmCalls:e.callDataPoints.map(n=>({sessionCallIndex:n.sessionCallIndex,responseIndex:n.responseIndex,callIndex:n.callIndex,timestamp:n.timestamp,mode:n.mode,promptTokens:n.promptTokens,completionTokens:n.completionTokens,ttft:n.ttft,completionTime:n.completionTime,prefillSpeed:n.prefillSpeed,generationSpeed:n.generationSpeed,totalTime:n.totalTime}))}}function BN({isOpen:e,onClose:n,stats:l}){const i=_.useRef(null),[s,c]=_.useState({}),[d,f]=_.useState(()=>{var N;return((N=l.modelGroups[0])==null?void 0:N.key)??""});_.useEffect(()=>{var N;l.modelGroups.some(j=>j.key===d)||f(((N=l.modelGroups[0])==null?void 0:N.key)??"")},[d,l.modelGroups]);const p=_.useMemo(()=>l.modelGroups.find(N=>N.key===d)??l.modelGroups[0],[d,l.modelGroups]),m=_.useMemo(()=>p?RN(p):[],[p]),x=_.useMemo(()=>p?DN(p):{mode:"responses",xLabel:"response",prefillLabel:"",generationLabel:"",points:[]},[p]),b=_.useMemo(()=>m.reduce((N,j)=>N+1+(s[j.messageId]??!1?j.calls.length:0),0),[s,m]),y=_.useCallback(N=>{c(j=>({...j,[N]:!j[N]}))},[]),v=_.useCallback(()=>{if(!p)return;const N=IN(p);navigator.clipboard.writeText(JSON.stringify(N,null,2)).catch(j=>console.error("Failed to copy:",j))},[p]),w=_.useCallback(async()=>{if(i.current)try{const N=(await EN(async()=>{const{default:T}=await import("./html2canvas.esm-QH1iLAAe.js");return{default:T}},[])).default,j=await N(i.current,{backgroundColor:"#1a1a1a",scale:2}),k=document.createElement("a");k.download=`openfox-stats-${new Date().toISOString().slice(0,10)}.png`,k.href=j.toDataURL("image/png"),k.click()}catch(N){console.error("Failed to export PNG:",N),v()}},[v]);return u.jsx(In,{isOpen:e,onClose:n,title:"Session Stats",size:"lg",children:u.jsxs("div",{ref:i,className:"space-y-6",children:[u.jsx("section",{children:u.jsx("div",{className:"flex flex-wrap gap-2",children:l.modelGroups.map(N=>u.jsx("button",{onClick:()=>f(N.key),className:`px-3 py-1.5 rounded border text-xs transition-colors ${N.key===(p==null?void 0:p.key)?"border-accent-primary bg-accent-primary/10 text-accent-primary":"border-border text-text-muted hover:text-text-primary hover:bg-bg-tertiary/40"}`,title:N.label,children:N.label},N.key))})}),p&&u.jsxs("section",{children:[u.jsx("h3",{className:"text-sm font-semibold text-text-secondary mb-3 uppercase tracking-wide",children:"Summary"}),u.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[u.jsx(Yr,{label:"AI Time",value:vf(p.aiTime)}),u.jsx(Yr,{label:"Total Time",value:vf(p.totalTime)}),u.jsx(Yr,{label:"Tool Time",value:vf(p.toolTime)}),u.jsx(Yr,{label:"Responses",value:p.responseCount.toString()}),u.jsx(Yr,{label:"LLM Calls",value:p.llmCallCount.toString()})]}),u.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mt-3",children:[u.jsx(Yr,{label:"Prefill Tokens",value:li(p.prefillTokens),subValue:`@ ${ps(p.avgPrefillSpeed)} tok/s`}),u.jsx(Yr,{label:"Gen Tokens",value:li(p.generationTokens),subValue:`@ ${ps(p.avgGenerationSpeed)} tok/s`}),u.jsx(Yr,{label:"Avg PP Speed",value:`${ps(p.avgPrefillSpeed)}`,subValue:"tok/s"}),u.jsx(Yr,{label:"Avg TG Speed",value:`${ps(p.avgGenerationSpeed)}`,subValue:"tok/s"})]})]}),p&&x.points.length>1&&u.jsxs("section",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-3",children:[u.jsx("h3",{className:"text-sm font-semibold text-text-secondary uppercase tracking-wide",children:"Performance Progression"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:v,className:"px-2 py-1 text-xs text-text-muted hover:text-text-primary hover:bg-bg-tertiary rounded transition-colors",children:"Copy JSON"}),u.jsx("button",{onClick:w,className:"px-2 py-1 text-xs text-text-muted hover:text-text-primary hover:bg-bg-tertiary rounded transition-colors",children:"Save PNG"})]})]}),u.jsx("div",{className:"bg-bg-tertiary/50 rounded p-4",children:u.jsx(_N,{data:x.points,width:50,prefillLabel:x.prefillLabel,generationLabel:x.generationLabel,xLabel:x.xLabel})})]}),p&&u.jsxs("section",{children:[u.jsxs("h3",{className:"text-sm font-semibold text-text-secondary mb-3 uppercase tracking-wide",children:["Response Log (",p.responseCount," responses)"]}),u.jsx("div",{className:`${b>6?"max-h-72 overflow-y-auto":"overflow-hidden"} bg-bg-tertiary/30 rounded`,children:u.jsxs("table",{className:"w-full table-fixed border-separate border-spacing-0 text-xs",children:[u.jsxs("colgroup",{children:[u.jsx("col",{className:"w-[7%]"}),u.jsx("col",{className:"w-[14%]"}),u.jsx("col",{className:"w-[10%]"}),u.jsx("col",{className:"w-[14%]"}),u.jsx("col",{className:"w-[14%]"}),u.jsx("col",{className:"w-[14%]"}),u.jsx("col",{className:"w-[11%]"}),u.jsx("col",{className:"w-[2%]"})]}),u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wide text-text-muted/80",children:[u.jsx("th",{className:"px-3 py-2 text-center font-medium",children:"#"}),u.jsx("th",{className:"px-2 py-2 text-center font-medium",children:"At"}),u.jsx("th",{className:"px-2 py-2 text-center font-medium",children:"Time"}),u.jsx("th",{className:"px-2 py-2 text-center font-medium",children:"Context"}),u.jsx("th",{className:"px-2 py-2 text-center font-medium",children:"PP t/s"}),u.jsx("th",{className:"px-2 py-2 text-center font-medium",children:"TG t/s"}),u.jsx("th",{className:"px-2 py-2 text-center font-medium",children:"Calls"}),u.jsx("th",{className:"px-2 py-2"})]})}),u.jsx("tbody",{children:m.map((N,j)=>u.jsxs(_.Fragment,{children:[u.jsx(HN,{row:N,index:j,isExpanded:s[N.messageId]??!1,onToggle:N.isExpandable?()=>y(N.messageId):void 0}),(s[N.messageId]??!1)&&N.calls.map((k,T)=>u.jsx(UN,{dataPoint:k,index:T},`${k.messageId}-${k.callIndex}`))]},N.messageId))})]})})]})]})})}function Yr({label:e,value:n,subValue:l}){return u.jsxs("div",{className:"bg-bg-tertiary/50 rounded p-3",children:[u.jsx("div",{className:"text-text-muted text-xs mb-1",children:e}),u.jsx("div",{className:"text-text-primary text-lg font-semibold",children:n}),l&&u.jsx("div",{className:"text-text-muted text-xs",children:l})]})}function HN({row:e,index:n,isExpanded:l,onToggle:i}){const s=e.calls.length>0?LN(e.calls.map(c=>c.promptTokens)):`${li(e.prefillTokens)} ctx`;return u.jsxs("tr",{onClick:i,className:`${n%2===0?"bg-bg-tertiary/20":""} ${i?"cursor-pointer hover:bg-bg-tertiary/35 transition-colors":""}`,children:[u.jsx("td",{className:"px-3 py-2 text-center text-text-muted align-middle",children:e.responseIndex}),u.jsx("td",{className:"px-2 py-2 text-center text-text-muted font-mono align-middle whitespace-nowrap",children:vv(e.timestamp)}),u.jsxs("td",{className:"px-2 py-2 text-center text-text-muted align-middle whitespace-nowrap",children:[e.totalTime.toFixed(1),"s"]}),u.jsx("td",{className:"px-2 py-2 text-center text-text-primary font-mono align-middle whitespace-nowrap",children:s.replace(/ ctx$/,"")}),u.jsx("td",{className:"px-2 py-2 text-center text-text-primary font-mono align-middle whitespace-nowrap",children:vc(e.prefillSpeed)}),u.jsx("td",{className:"px-2 py-2 text-center text-text-primary font-mono align-middle whitespace-nowrap",children:vc(e.generationSpeed)}),u.jsx("td",{className:"px-2 py-2 text-center text-text-muted font-mono align-middle whitespace-nowrap",children:e.callCount}),u.jsx("td",{className:"px-2 py-2 text-center text-text-muted align-middle whitespace-nowrap",children:e.isExpandable?l?"v":">":""})]})}function UN({dataPoint:e,index:n}){return u.jsxs("tr",{className:`${n%2===0?"bg-bg-tertiary/10":"bg-bg-tertiary/5"}`,children:[u.jsxs("td",{className:"px-3 py-2 pl-6 text-center text-text-muted align-middle border-l border-border/60",children:["c",e.callIndex]}),u.jsx("td",{className:"px-2 py-2 text-center text-text-muted font-mono align-middle whitespace-nowrap",children:vv(e.timestamp)}),u.jsxs("td",{className:"px-2 py-2 text-center text-text-muted align-middle whitespace-nowrap",children:[e.totalTime.toFixed(1),"s"]}),u.jsx("td",{className:"px-2 py-2 text-center text-text-primary font-mono align-middle whitespace-nowrap",children:li(e.promptTokens)}),u.jsx("td",{className:"px-2 py-2 text-center text-text-primary font-mono align-middle whitespace-nowrap",children:vc(e.prefillSpeed)}),u.jsx("td",{className:"px-2 py-2 text-center text-text-primary font-mono align-middle whitespace-nowrap",children:vc(e.generationSpeed)}),u.jsx("td",{className:"px-2 py-2 text-center text-text-muted font-mono align-middle whitespace-nowrap",children:e.callIndex}),u.jsx("td",{className:"px-2 py-2"})]})}const FN={pending:{icon:"○",color:"text-text-muted",label:"Pending"},in_progress:{icon:"●",color:"text-accent-warning",label:"In Progress",animate:!0},completed:{icon:"◉",color:"text-purple-400",label:"Completed"},passed:{icon:"✓",color:"text-accent-success",label:"Passed"},failed:{icon:"✗",color:"text-accent-error",label:"Failed"}},$N=_.memo(function({criteria:n}){if(n.length===0)return u.jsx("div",{className:"text-text-muted text-sm text-center py-2",children:"No criteria yet"});const l={pending:0,in_progress:0,completed:0,passed:0,failed:0};for(const s of n){const c=s.status.type;c in l&&l[c]++}const i=Object.keys(l).filter(s=>l[s]>0);return u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[u.jsx("span",{className:"font-semibold text-text-primary",children:"Total:"}),u.jsx("span",{className:"text-text-secondary",children:n.length})]}),u.jsx("div",{className:"space-y-1",children:i.map(s=>{const c=FN[s];return u.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[u.jsx("span",{className:`${c.color} ${c.animate?"animate-pulse":""} text-sm leading-tight`,children:c.icon}),u.jsxs("span",{className:"text-text-muted",children:[c.label,":"]}),u.jsx("span",{className:"text-text-primary font-medium",children:l[s]})]},s)})})]})});function GN({summary:e,messages:n,workdir:l}){const[i,s]=_.useState(!1),c=wN(n),{branch:d}=kN(l),f=Ae(p=>p.currentSession);return u.jsxs("div",{className:"flex flex-col h-full",children:[c&&u.jsxs("div",{className:"mb-4",children:[u.jsx("button",{onClick:()=>s(!0),className:"w-full flex items-center justify-center px-3 py-2 rounded bg-bg-tertiary hover:bg-bg-secondary transition-colors",title:"View detailed response and call-level stats",children:u.jsxs("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[u.jsx("span",{className:"text-text-secondary",children:jN(c.aiTime)}),u.jsx("span",{className:"w-px h-3 bg-border"}),u.jsx("span",{className:"text-text-secondary",children:iy(c.avgPrefillSpeed)}),u.jsx("span",{children:"pp"}),u.jsx("span",{className:"w-px h-3 bg-border"}),u.jsx("span",{className:"text-text-secondary",children:iy(c.avgGenerationSpeed)}),u.jsx("span",{children:"tg"})]})}),u.jsx(BN,{isOpen:i,onClose:()=>s(!1),stats:c})]}),u.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto",children:[u.jsx("div",{className:"flex items-center justify-between mb-2",children:u.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:"Summary"})}),e?u.jsx("p",{className:"text-sm text-text-primary leading-relaxed",children:e}):u.jsx("div",{className:"text-text-muted text-sm text-center py-2",children:"No summary yet"}),u.jsxs("div",{className:"mt-4",children:[u.jsx("h3",{className:"text-sm font-semibold text-text-primary mb-2",children:"Progress"}),u.jsx($N,{criteria:(f==null?void 0:f.criteria)??[]})]})]}),d&&u.jsxs("div",{className:"mt-4 pt-3 border-t border-border flex items-center gap-2 text-xs text-text-muted",children:[u.jsx("svg",{className:"w-3.5 h-3.5 flex-shrink-0",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:u.jsx("path",{fillRule:"evenodd",d:"M11.5 7V4a1 1 0 011 1v14a1 1 0 01-1-1v-3c-1.65 0-3.15.5-4.5 1.5V19a1 1 0 01-1-1V5a1 1 0 011 1v3c1.35-1 2.85-1.5 4.5-1.5zm6 0a1 1 0 011 1v11a1 1 0 01-1 1v-3c-1.65 0-3.15.5-4.5 1.5V19a1 1 0 01-1-1V5a1 1 0 011 1v3c1.35-1 2.85-1.5 4.5-1.5z",clipRule:"evenodd"})}),u.jsx("span",{className:"truncate",children:d})]})]})}const qN="w-[320px] min-w-[320px] shrink-0 border-l border-border p-4 overflow-y-auto";function VN({children:e,criteriaSidebarOpen:n=!0,messages:l}){const i=Ae(s=>s.currentSession);return u.jsxs("div",{className:"flex h-full overflow-hidden",children:[u.jsx("div",{className:"flex-1 min-w-0 flex flex-col overflow-hidden",children:e}),u.jsx("aside",{className:`
67
- ${qN}
68
- hidden md:block
69
- ${n?"md:block":"md:hidden"}
70
- `,children:u.jsx(GN,{summary:(i==null?void 0:i.summary)??null,messages:l,workdir:i==null?void 0:i.workdir})})]})}function YN(e,n){return n||e>85?"bg-accent-error":e>60?"bg-accent-warning":"bg-accent-success"}function uy(e,n){return n||e>85?"text-accent-error":e>60?"text-accent-warning":"text-text-muted"}function XN({criteriaSidebarOpen:e=!0,onCriteriaSidebarToggle:n}){const l=Ae(b=>b.contextState),i=Ae(b=>b.currentSession),s=Ae(b=>b.compactContext);if(!l||!i)return null;const{currentTokens:c,maxTokens:d,compactionCount:f,dangerZone:p}=l,m=Math.round(c/d*100),x=i.isRunning;return u.jsx("div",{className:"flex-shrink-0 px-4 py-1.5 border-b border-border bg-bg-secondary/50",children:u.jsxs("div",{className:"flex items-center justify-between gap-4",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[u.jsx("span",{className:"text-text-muted",children:"Context:"}),u.jsxs("span",{className:uy(m,p),children:[ly(c)," / ",ly(d)]}),u.jsxs("span",{className:uy(m,p),children:["(",m,"%)"]})]}),u.jsx("div",{className:"h-1.5 bg-bg-tertiary rounded-full overflow-hidden w-20",children:u.jsx("div",{className:`h-full transition-all duration-300 ${YN(m,p)}`,style:{width:`${Math.min(m,100)}%`}})}),p&&u.jsx("span",{className:"text-[10px] text-accent-error font-medium animate-pulse",children:"Low!"}),f>0&&u.jsxs("span",{className:"text-[10px] text-text-muted bg-bg-tertiary px-1 py-0.5 rounded",children:[f,"x"]}),u.jsx(gt,{variant:"secondary",size:"md",onClick:s,disabled:x,title:x?"Cannot compact while running":"Compact context",className:p?"border-accent-error text-accent-error hover:bg-accent-error/10":"",children:"Compact"})]}),n&&u.jsx("button",{onClick:n,className:"flex md:hidden items-center justify-center p-1.5 rounded hover:bg-bg-tertiary text-text-muted hover:text-text-primary transition-colors",title:e?"Hide criteria sidebar":"Show criteria sidebar",children:u.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})})})]})})}function dy(e){const n=[],l=String(e||"");let i=l.indexOf(","),s=0,c=!1;for(;!c;){i===-1&&(i=l.length,c=!0);const d=l.slice(s,i).trim();(d||!c)&&n.push(d),s=i+1,i=l.indexOf(",",s)}return n}function PN(e,n){const l={};return(e[e.length-1]===""?[...e,""]:e).join((l.padRight?" ":"")+","+(l.padLeft===!1?"":" ")).trim()}const QN=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZN=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,KN={};function fy(e,n){return(KN.jsx?ZN:QN).test(e)}const WN=/[ \t\n\f\r]/g;function JN(e){return typeof e=="object"?e.type==="text"?my(e.value):!1:my(e)}function my(e){return e.replace(WN,"")===""}class Hs{constructor(n,l,i){this.normal=l,this.property=n,i&&(this.space=i)}}Hs.prototype.normal={};Hs.prototype.property={};Hs.prototype.space=void 0;function Sv(e,n){const l={},i={};for(const s of e)Object.assign(l,s.property),Object.assign(i,s.normal);return new Hs(l,i,n)}function Ts(e){return e.toLowerCase()}class Bn{constructor(n,l){this.attribute=l,this.property=n}}Bn.prototype.attribute="";Bn.prototype.booleanish=!1;Bn.prototype.boolean=!1;Bn.prototype.commaOrSpaceSeparated=!1;Bn.prototype.commaSeparated=!1;Bn.prototype.defined=!1;Bn.prototype.mustUseProperty=!1;Bn.prototype.number=!1;Bn.prototype.overloadedBoolean=!1;Bn.prototype.property="";Bn.prototype.spaceSeparated=!1;Bn.prototype.space=void 0;let eC=0;const Ke=ci(),Kt=ci(),Zf=ci(),be=ci(),Et=ci(),sa=ci(),Xn=ci();function ci(){return 2**++eC}const Kf=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ke,booleanish:Kt,commaOrSpaceSeparated:Xn,commaSeparated:sa,number:be,overloadedBoolean:Zf,spaceSeparated:Et},Symbol.toStringTag,{value:"Module"})),Sf=Object.keys(Kf);class Am extends Bn{constructor(n,l,i,s){let c=-1;if(super(n,l),py(this,"space",s),typeof i=="number")for(;++c<Sf.length;){const d=Sf[c];py(this,Sf[c],(i&Kf[d])===Kf[d])}}}Am.prototype.defined=!0;function py(e,n,l){l&&(e[n]=l)}function fa(e){const n={},l={};for(const[i,s]of Object.entries(e.properties)){const c=new Am(i,e.transform(e.attributes||{},i),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(c.mustUseProperty=!0),n[i]=c,l[Ts(i)]=i,l[Ts(c.attribute)]=i}return new Hs(n,l,e.space)}const wv=fa({properties:{ariaActiveDescendant:null,ariaAtomic:Kt,ariaAutoComplete:null,ariaBusy:Kt,ariaChecked:Kt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:Et,ariaCurrent:null,ariaDescribedBy:Et,ariaDetails:null,ariaDisabled:Kt,ariaDropEffect:Et,ariaErrorMessage:null,ariaExpanded:Kt,ariaFlowTo:Et,ariaGrabbed:Kt,ariaHasPopup:null,ariaHidden:Kt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Et,ariaLevel:be,ariaLive:null,ariaModal:Kt,ariaMultiLine:Kt,ariaMultiSelectable:Kt,ariaOrientation:null,ariaOwns:Et,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Kt,ariaReadOnly:Kt,ariaRelevant:null,ariaRequired:Kt,ariaRoleDescription:Et,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Kt,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function kv(e,n){return n in e?e[n]:n}function jv(e,n){return kv(e,n.toLowerCase())}const tC=fa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:sa,acceptCharset:Et,accessKey:Et,action:null,allow:null,allowFullScreen:Ke,allowPaymentRequest:Ke,allowUserMedia:Ke,alt:null,as:null,async:Ke,autoCapitalize:null,autoComplete:Et,autoFocus:Ke,autoPlay:Ke,blocking:Et,capture:null,charSet:null,checked:Ke,cite:null,className:Et,cols:be,colSpan:null,content:null,contentEditable:Kt,controls:Ke,controlsList:Et,coords:be|sa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ke,defer:Ke,dir:null,dirName:null,disabled:Ke,download:Zf,draggable:Kt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ke,formTarget:null,headers:Et,height:be,hidden:Zf,high:be,href:null,hrefLang:null,htmlFor:Et,httpEquiv:Et,id:null,imageSizes:null,imageSrcSet:null,inert:Ke,inputMode:null,integrity:null,is:null,isMap:Ke,itemId:null,itemProp:Et,itemRef:Et,itemScope:Ke,itemType:Et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ke,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Ke,muted:Ke,name:null,nonce:null,noModule:Ke,noValidate:Ke,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ke,optimum:be,pattern:null,ping:Et,placeholder:null,playsInline:Ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ke,referrerPolicy:null,rel:Et,required:Ke,reversed:Ke,rows:be,rowSpan:be,sandbox:Et,scope:null,scoped:Ke,seamless:Ke,selected:Ke,shadowRootClonable:Ke,shadowRootDelegatesFocus:Ke,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Kt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Ke,useMap:null,value:Kt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Et,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ke,declare:Ke,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Ke,noHref:Ke,noShade:Ke,noWrap:Ke,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Kt,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ke,disableRemotePlayback:Ke,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:jv}),nC=fa({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Xn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:Et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:sa,g2:sa,glyphName:sa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:Xn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xn,rev:Xn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xn,requiredFeatures:Xn,requiredFonts:Xn,requiredFormats:Xn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:Xn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:kv}),Nv=fa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),Cv=fa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jv}),Ev=fa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),rC={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},lC=/[A-Z]/g,hy=/-[a-z]/g,iC=/^data[-\w.:]+$/i;function Tv(e,n){const l=Ts(n);let i=n,s=Bn;if(l in e.normal)return e.property[e.normal[l]];if(l.length>4&&l.slice(0,4)==="data"&&iC.test(n)){if(n.charAt(4)==="-"){const c=n.slice(5).replace(hy,sC);i="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=n.slice(4);if(!hy.test(c)){let d=c.replace(lC,aC);d.charAt(0)!=="-"&&(d="-"+d),n="data"+d}}s=Am}return new s(i,n)}function aC(e){return"-"+e.toLowerCase()}function sC(e){return e.charAt(1).toUpperCase()}const Av=Sv([wv,tC,Nv,Cv,Ev],"html"),Rc=Sv([wv,nC,Nv,Cv,Ev],"svg");function gy(e){const n=String(e||"").trim();return n?n.split(/[ \t\n\r\f]+/g):[]}function oC(e){return e.join(" ").trim()}var Ji={},wf,xy;function cC(){if(xy)return wf;xy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,l=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,f=/^\s+|\s+$/g,p=`
71
- `,m="/",x="*",b="",y="comment",v="declaration";function w(j,k){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];k=k||{};var T=1,C=1;function L(H){var q=H.match(n);q&&(T+=q.length);var B=H.lastIndexOf(p);C=~B?H.length-B:C+H.length}function G(){var H={line:T,column:C};return function(q){return q.position=new I(H),U(),q}}function I(H){this.start=H,this.end={line:T,column:C},this.source=k.source}I.prototype.content=j;function R(H){var q=new Error(k.source+":"+T+":"+C+": "+H);if(q.reason=H,q.filename=k.source,q.line=T,q.column=C,q.source=j,!k.silent)throw q}function X(H){var q=H.exec(j);if(q){var B=q[0];return L(B),j=j.slice(B.length),q}}function U(){X(l)}function D(H){var q;for(H=H||[];q=Q();)q!==!1&&H.push(q);return H}function Q(){var H=G();if(!(m!=j.charAt(0)||x!=j.charAt(1))){for(var q=2;b!=j.charAt(q)&&(x!=j.charAt(q)||m!=j.charAt(q+1));)++q;if(q+=2,b===j.charAt(q-1))return R("End of comment missing");var B=j.slice(2,q-2);return C+=2,L(B),j=j.slice(q),C+=2,H({type:y,comment:B})}}function M(){var H=G(),q=X(i);if(q){if(Q(),!X(s))return R("property missing ':'");var B=X(c),P=H({type:v,property:N(q[0].replace(e,b)),value:B?N(B[0].replace(e,b)):b});return X(d),P}}function V(){var H=[];D(H);for(var q;q=M();)q!==!1&&(H.push(q),D(H));return H}return U(),V()}function N(j){return j?j.replace(f,b):b}return wf=w,wf}var by;function uC(){if(by)return Ji;by=1;var e=Ji&&Ji.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.default=l;const n=e(cC());function l(i,s){let c=null;if(!i||typeof i!="string")return c;const d=(0,n.default)(i),f=typeof s=="function";return d.forEach(p=>{if(p.type!=="declaration")return;const{property:m,value:x}=p;f?s(m,x,p):x&&(c=c||{},c[m]=x)}),c}return Ji}var cs={},yy;function dC(){if(yy)return cs;yy=1,Object.defineProperty(cs,"__esModule",{value:!0}),cs.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,l=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,c=function(m){return!m||l.test(m)||e.test(m)},d=function(m,x){return x.toUpperCase()},f=function(m,x){return"".concat(x,"-")},p=function(m,x){return x===void 0&&(x={}),c(m)?m:(m=m.toLowerCase(),x.reactCompat?m=m.replace(s,f):m=m.replace(i,f),m.replace(n,d))};return cs.camelCase=p,cs}var us,vy;function fC(){if(vy)return us;vy=1;var e=us&&us.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(uC()),l=dC();function i(s,c){var d={};return!s||typeof s!="string"||(0,n.default)(s,function(f,p){f&&p&&(d[(0,l.camelCase)(f,c)]=p)}),d}return i.default=i,us=i,us}var mC=fC();const pC=zs(mC),Ov=_v("end"),Om=_v("start");function _v(e){return n;function n(l){const i=l&&l.position&&l.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function hC(e){const n=Om(e),l=Ov(e);if(n&&l)return{start:n,end:l}}function xs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Sy(e.position):"start"in e||"end"in e?Sy(e):"line"in e||"column"in e?Wf(e):""}function Wf(e){return wy(e&&e.line)+":"+wy(e&&e.column)}function Sy(e){return Wf(e&&e.start)+"-"+Wf(e&&e.end)}function wy(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(n,l,i){super(),typeof l=="string"&&(i=l,l=void 0);let s="",c={},d=!1;if(l&&("line"in l&&"column"in l?c={place:l}:"start"in l&&"end"in l?c={place:l}:"type"in l?c={ancestors:[l],place:l.position}:c={...l}),typeof n=="string"?s=n:!c.cause&&n&&(d=!0,s=n.message,c.cause=n),!c.ruleId&&!c.source&&typeof i=="string"){const p=i.indexOf(":");p===-1?c.ruleId=i:(c.source=i.slice(0,p),c.ruleId=i.slice(p+1))}if(!c.place&&c.ancestors&&c.ancestors){const p=c.ancestors[c.ancestors.length-1];p&&(c.place=p.position)}const f=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=xs(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const _m={}.hasOwnProperty,gC=new Map,xC=/[A-Z]/g,bC=new Set(["table","tbody","thead","tfoot","tr"]),yC=new Set(["td","th"]),Rv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vC(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const l=n.filePath||void 0;let i;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=TC(l,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=EC(l,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:i,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:l,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Rc:Av,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},c=Mv(s,e,void 0);return c&&typeof c!="string"?c:s.create(e,s.Fragment,{children:c||void 0},void 0)}function Mv(e,n,l){if(n.type==="element")return SC(e,n,l);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return wC(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return jC(e,n,l);if(n.type==="mdxjsEsm")return kC(e,n);if(n.type==="root")return NC(e,n,l);if(n.type==="text")return CC(e,n)}function SC(e,n,l){const i=e.schema;let s=i;n.tagName.toLowerCase()==="svg"&&i.space==="html"&&(s=Rc,e.schema=s),e.ancestors.push(n);const c=Dv(e,n.tagName,!1),d=AC(e,n);let f=Mm(e,n);return bC.has(n.tagName)&&(f=f.filter(function(p){return typeof p=="string"?!JN(p):!0})),zv(e,d,c,n),Rm(d,f),e.ancestors.pop(),e.schema=i,e.create(n,c,d,l)}function wC(e,n){if(n.data&&n.data.estree&&e.evaluater){const i=n.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}As(e,n.position)}function kC(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);As(e,n.position)}function jC(e,n,l){const i=e.schema;let s=i;n.name==="svg"&&i.space==="html"&&(s=Rc,e.schema=s),e.ancestors.push(n);const c=n.name===null?e.Fragment:Dv(e,n.name,!0),d=OC(e,n),f=Mm(e,n);return zv(e,d,c,n),Rm(d,f),e.ancestors.pop(),e.schema=i,e.create(n,c,d,l)}function NC(e,n,l){const i={};return Rm(i,Mm(e,n)),e.create(n,e.Fragment,i,l)}function CC(e,n){return n.value}function zv(e,n,l,i){typeof l!="string"&&l!==e.Fragment&&e.passNode&&(n.node=i)}function Rm(e,n){if(n.length>0){const l=n.length>1?n:n[0];l&&(e.children=l)}}function EC(e,n,l){return i;function i(s,c,d,f){const m=Array.isArray(d.children)?l:n;return f?m(c,d,f):m(c,d)}}function TC(e,n){return l;function l(i,s,c,d){const f=Array.isArray(c.children),p=Om(i);return n(s,c,d,f,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function AC(e,n){const l={};let i,s;for(s in n.properties)if(s!=="children"&&_m.call(n.properties,s)){const c=_C(e,s,n.properties[s]);if(c){const[d,f]=c;e.tableCellAlignToStyle&&d==="align"&&typeof f=="string"&&yC.has(n.tagName)?i=f:l[d]=f}}if(i){const c=l.style||(l.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return l}function OC(e,n){const l={};for(const i of n.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const c=i.data.estree.body[0];c.type;const d=c.expression;d.type;const f=d.properties[0];f.type,Object.assign(l,e.evaluater.evaluateExpression(f.argument))}else As(e,n.position);else{const s=i.name;let c;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const f=i.value.data.estree.body[0];f.type,c=e.evaluater.evaluateExpression(f.expression)}else As(e,n.position);else c=i.value===null?!0:i.value;l[s]=c}return l}function Mm(e,n){const l=[];let i=-1;const s=e.passKeys?new Map:gC;for(;++i<n.children.length;){const c=n.children[i];let d;if(e.passKeys){const p=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(p){const m=s.get(p)||0;d=p+"-"+m,s.set(p,m+1)}}const f=Mv(e,c,d);f!==void 0&&l.push(f)}return l}function _C(e,n,l){const i=Tv(e.schema,n);if(!(l==null||typeof l=="number"&&Number.isNaN(l))){if(Array.isArray(l)&&(l=i.commaSeparated?PN(l):oC(l)),i.property==="style"){let s=typeof l=="object"?l:RC(e,String(l));return e.stylePropertyNameCase==="css"&&(s=MC(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&i.space?rC[i.property]||i.property:i.attribute,l]}}function RC(e,n){try{return pC(n,{reactCompat:!0})}catch(l){if(e.ignoreInvalidStyle)return{};const i=l,s=new wn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=Rv+"#cannot-parse-style-attribute",s}}function Dv(e,n,l){let i;if(!l)i={type:"Literal",value:n};else if(n.includes(".")){const s=n.split(".");let c=-1,d;for(;++c<s.length;){const f=fy(s[c])?{type:"Identifier",name:s[c]}:{type:"Literal",value:s[c]};d=d?{type:"MemberExpression",object:d,property:f,computed:!!(c&&f.type==="Literal"),optional:!1}:f}i=d}else i=fy(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(i.type==="Literal"){const s=i.value;return _m.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(i);As(e)}function As(e,n){const l=new wn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=Rv+"#cannot-handle-mdx-estrees-without-createevaluater",l}function MC(e){const n={};let l;for(l in e)_m.call(e,l)&&(n[zC(l)]=e[l]);return n}function zC(e){let n=e.replace(xC,DC);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function DC(e){return"-"+e.toLowerCase()}const kf={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},LC={};function zm(e,n){const l=LC,i=typeof l.includeImageAlt=="boolean"?l.includeImageAlt:!0,s=typeof l.includeHtml=="boolean"?l.includeHtml:!0;return Lv(e,i,s)}function Lv(e,n,l){if(IC(e)){if("value"in e)return e.type==="html"&&!l?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ky(e.children,n,l)}return Array.isArray(e)?ky(e,n,l):""}function ky(e,n,l){const i=[];let s=-1;for(;++s<e.length;)i[s]=Lv(e[s],n,l);return i.join("")}function IC(e){return!!(e&&typeof e=="object")}const jy=document.createElement("i");function Os(e){const n="&"+e+";";jy.innerHTML=n;const l=jy.textContent;return l.charCodeAt(l.length-1)===59&&e!=="semi"||l===n?!1:l}function Kn(e,n,l,i){const s=e.length;let c=0,d;if(n<0?n=-n>s?0:s+n:n=n>s?s:n,l=l>0?l:0,i.length<1e4)d=Array.from(i),d.unshift(n,l),e.splice(...d);else for(l&&e.splice(n,l);c<i.length;)d=i.slice(c,c+1e4),d.unshift(n,0),e.splice(...d),c+=1e4,n+=1e4}function or(e,n){return e.length>0?(Kn(e,e.length,0,n),e):n}const Ny={}.hasOwnProperty;function Iv(e){const n={};let l=-1;for(;++l<e.length;)BC(n,e[l]);return n}function BC(e,n){let l;for(l in n){const s=(Ny.call(e,l)?e[l]:void 0)||(e[l]={}),c=n[l];let d;if(c)for(d in c){Ny.call(s,d)||(s[d]=[]);const f=c[d];HC(s[d],Array.isArray(f)?f:f?[f]:[])}}}function HC(e,n){let l=-1;const i=[];for(;++l<n.length;)(n[l].add==="after"?e:i).push(n[l]);Kn(e,0,0,i)}function Bv(e,n){const l=Number.parseInt(e,n);return l<9||l===11||l>13&&l<32||l>126&&l<160||l>55295&&l<57344||l>64975&&l<65008||(l&65535)===65535||(l&65535)===65534||l>1114111?"�":String.fromCodePoint(l)}function gr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Cn=Rl(/[A-Za-z]/),Sn=Rl(/[\dA-Za-z]/),UC=Rl(/[#-'*+\--9=?A-Z^-~]/);function Sc(e){return e!==null&&(e<32||e===127)}const Jf=Rl(/\d/),FC=Rl(/[\dA-Fa-f]/),$C=Rl(/[!-/:-@[-`{-~]/);function Ie(e){return e!==null&&e<-2}function Ct(e){return e!==null&&(e<0||e===32)}function rt(e){return e===-2||e===-1||e===32}const Mc=Rl(new RegExp("\\p{P}|\\p{S}","u")),ai=Rl(/\s/);function Rl(e){return n;function n(l){return l!==null&&l>-1&&e.test(String.fromCharCode(l))}}function ma(e){const n=[];let l=-1,i=0,s=0;for(;++l<e.length;){const c=e.charCodeAt(l);let d="";if(c===37&&Sn(e.charCodeAt(l+1))&&Sn(e.charCodeAt(l+2)))s=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(d=String.fromCharCode(c));else if(c>55295&&c<57344){const f=e.charCodeAt(l+1);c<56320&&f>56319&&f<57344?(d=String.fromCharCode(c,f),s=1):d="�"}else d=String.fromCharCode(c);d&&(n.push(e.slice(i,l),encodeURIComponent(d)),i=l+s+1,d=""),s&&(l+=s,s=0)}return n.join("")+e.slice(i)}function ut(e,n,l,i){const s=i?i-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(p){return rt(p)?(e.enter(l),f(p)):n(p)}function f(p){return rt(p)&&c++<s?(e.consume(p),f):(e.exit(l),n(p))}}const GC={tokenize:qC};function qC(e){const n=e.attempt(this.parser.constructs.contentInitial,i,s);let l;return n;function i(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ut(e,n,"linePrefix")}function s(f){return e.enter("paragraph"),c(f)}function c(f){const p=e.enter("chunkText",{contentType:"text",previous:l});return l&&(l.next=p),l=p,d(f)}function d(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ie(f)?(e.consume(f),e.exit("chunkText"),c):(e.consume(f),d)}}const VC={tokenize:YC},Cy={tokenize:XC};function YC(e){const n=this,l=[];let i=0,s,c,d;return f;function f(C){if(i<l.length){const L=l[i];return n.containerState=L[1],e.attempt(L[0].continuation,p,m)(C)}return m(C)}function p(C){if(i++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,s&&T();const L=n.events.length;let G=L,I;for(;G--;)if(n.events[G][0]==="exit"&&n.events[G][1].type==="chunkFlow"){I=n.events[G][1].end;break}k(i);let R=L;for(;R<n.events.length;)n.events[R][1].end={...I},R++;return Kn(n.events,G+1,0,n.events.slice(L)),n.events.length=R,m(C)}return f(C)}function m(C){if(i===l.length){if(!s)return y(C);if(s.currentConstruct&&s.currentConstruct.concrete)return w(C);n.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Cy,x,b)(C)}function x(C){return s&&T(),k(i),y(C)}function b(C){return n.parser.lazy[n.now().line]=i!==l.length,d=n.now().offset,w(C)}function y(C){return n.containerState={},e.attempt(Cy,v,w)(C)}function v(C){return i++,l.push([n.currentConstruct,n.containerState]),y(C)}function w(C){if(C===null){s&&T(),k(0),e.consume(C);return}return s=s||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:c}),N(C)}function N(C){if(C===null){j(e.exit("chunkFlow"),!0),k(0),e.consume(C);return}return Ie(C)?(e.consume(C),j(e.exit("chunkFlow")),i=0,n.interrupt=void 0,f):(e.consume(C),N)}function j(C,L){const G=n.sliceStream(C);if(L&&G.push(null),C.previous=c,c&&(c.next=C),c=C,s.defineSkip(C.start),s.write(G),n.parser.lazy[C.start.line]){let I=s.events.length;for(;I--;)if(s.events[I][1].start.offset<d&&(!s.events[I][1].end||s.events[I][1].end.offset>d))return;const R=n.events.length;let X=R,U,D;for(;X--;)if(n.events[X][0]==="exit"&&n.events[X][1].type==="chunkFlow"){if(U){D=n.events[X][1].end;break}U=!0}for(k(i),I=R;I<n.events.length;)n.events[I][1].end={...D},I++;Kn(n.events,X+1,0,n.events.slice(R)),n.events.length=I}}function k(C){let L=l.length;for(;L-- >C;){const G=l[L];n.containerState=G[1],G[0].exit.call(n,e)}l.length=C}function T(){s.write([null]),c=void 0,s=void 0,n.containerState._closeFlow=void 0}}function XC(e,n,l){return ut(e,e.attempt(this.parser.constructs.document,n,l),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function oa(e){if(e===null||Ct(e)||ai(e))return 1;if(Mc(e))return 2}function zc(e,n,l){const i=[];let s=-1;for(;++s<e.length;){const c=e[s].resolveAll;c&&!i.includes(c)&&(n=c(n,l),i.push(c))}return n}const em={name:"attention",resolveAll:PC,tokenize:QC};function PC(e,n){let l=-1,i,s,c,d,f,p,m,x;for(;++l<e.length;)if(e[l][0]==="enter"&&e[l][1].type==="attentionSequence"&&e[l][1]._close){for(i=l;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&n.sliceSerialize(e[i][1]).charCodeAt(0)===n.sliceSerialize(e[l][1]).charCodeAt(0)){if((e[i][1]._close||e[l][1]._open)&&(e[l][1].end.offset-e[l][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[l][1].end.offset-e[l][1].start.offset)%3))continue;p=e[i][1].end.offset-e[i][1].start.offset>1&&e[l][1].end.offset-e[l][1].start.offset>1?2:1;const b={...e[i][1].end},y={...e[l][1].start};Ey(b,-p),Ey(y,p),d={type:p>1?"strongSequence":"emphasisSequence",start:b,end:{...e[i][1].end}},f={type:p>1?"strongSequence":"emphasisSequence",start:{...e[l][1].start},end:y},c={type:p>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[l][1].start}},s={type:p>1?"strong":"emphasis",start:{...d.start},end:{...f.end}},e[i][1].end={...d.start},e[l][1].start={...f.end},m=[],e[i][1].end.offset-e[i][1].start.offset&&(m=or(m,[["enter",e[i][1],n],["exit",e[i][1],n]])),m=or(m,[["enter",s,n],["enter",d,n],["exit",d,n],["enter",c,n]]),m=or(m,zc(n.parser.constructs.insideSpan.null,e.slice(i+1,l),n)),m=or(m,[["exit",c,n],["enter",f,n],["exit",f,n],["exit",s,n]]),e[l][1].end.offset-e[l][1].start.offset?(x=2,m=or(m,[["enter",e[l][1],n],["exit",e[l][1],n]])):x=0,Kn(e,i-1,l-i+3,m),l=i+m.length-x-2;break}}for(l=-1;++l<e.length;)e[l][1].type==="attentionSequence"&&(e[l][1].type="data");return e}function QC(e,n){const l=this.parser.constructs.attentionMarkers.null,i=this.previous,s=oa(i);let c;return d;function d(p){return c=p,e.enter("attentionSequence"),f(p)}function f(p){if(p===c)return e.consume(p),f;const m=e.exit("attentionSequence"),x=oa(p),b=!x||x===2&&s||l.includes(p),y=!s||s===2&&x||l.includes(i);return m._open=!!(c===42?b:b&&(s||!y)),m._close=!!(c===42?y:y&&(x||!b)),n(p)}}function Ey(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const ZC={name:"autolink",tokenize:KC};function KC(e,n,l){let i=0;return s;function s(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(v){return Cn(v)?(e.consume(v),d):v===64?l(v):m(v)}function d(v){return v===43||v===45||v===46||Sn(v)?(i=1,f(v)):m(v)}function f(v){return v===58?(e.consume(v),i=0,p):(v===43||v===45||v===46||Sn(v))&&i++<32?(e.consume(v),f):(i=0,m(v))}function p(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),n):v===null||v===32||v===60||Sc(v)?l(v):(e.consume(v),p)}function m(v){return v===64?(e.consume(v),x):UC(v)?(e.consume(v),m):l(v)}function x(v){return Sn(v)?b(v):l(v)}function b(v){return v===46?(e.consume(v),i=0,x):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),n):y(v)}function y(v){if((v===45||Sn(v))&&i++<63){const w=v===45?y:b;return e.consume(v),w}return l(v)}}const Us={partial:!0,tokenize:WC};function WC(e,n,l){return i;function i(c){return rt(c)?ut(e,s,"linePrefix")(c):s(c)}function s(c){return c===null||Ie(c)?n(c):l(c)}}const Hv={continuation:{tokenize:eE},exit:tE,name:"blockQuote",tokenize:JC};function JC(e,n,l){const i=this;return s;function s(d){if(d===62){const f=i.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),c}return l(d)}function c(d){return rt(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(d))}}function eE(e,n,l){const i=this;return s;function s(d){return rt(d)?ut(e,c,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(Hv,n,l)(d)}}function tE(e){e.exit("blockQuote")}const Uv={name:"characterEscape",tokenize:nE};function nE(e,n,l){return i;function i(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),s}function s(c){return $C(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):l(c)}}const Fv={name:"characterReference",tokenize:rE};function rE(e,n,l){const i=this;let s=0,c,d;return f;function f(b){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),p}function p(b){return b===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(b),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,d=Sn,x(b))}function m(b){return b===88||b===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(b),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=FC,x):(e.enter("characterReferenceValue"),c=7,d=Jf,x(b))}function x(b){if(b===59&&s){const y=e.exit("characterReferenceValue");return d===Sn&&!Os(i.sliceSerialize(y))?l(b):(e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return d(b)&&s++<c?(e.consume(b),x):l(b)}}const Ty={partial:!0,tokenize:iE},Ay={concrete:!0,name:"codeFenced",tokenize:lE};function lE(e,n,l){const i=this,s={partial:!0,tokenize:G};let c=0,d=0,f;return p;function p(I){return m(I)}function m(I){const R=i.events[i.events.length-1];return c=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,f=I,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),x(I)}function x(I){return I===f?(d++,e.consume(I),x):d<3?l(I):(e.exit("codeFencedFenceSequence"),rt(I)?ut(e,b,"whitespace")(I):b(I))}function b(I){return I===null||Ie(I)?(e.exit("codeFencedFence"),i.interrupt?n(I):e.check(Ty,N,L)(I)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(I))}function y(I){return I===null||Ie(I)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),b(I)):rt(I)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ut(e,v,"whitespace")(I)):I===96&&I===f?l(I):(e.consume(I),y)}function v(I){return I===null||Ie(I)?b(I):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(I))}function w(I){return I===null||Ie(I)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),b(I)):I===96&&I===f?l(I):(e.consume(I),w)}function N(I){return e.attempt(s,L,j)(I)}function j(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),k}function k(I){return c>0&&rt(I)?ut(e,T,"linePrefix",c+1)(I):T(I)}function T(I){return I===null||Ie(I)?e.check(Ty,N,L)(I):(e.enter("codeFlowValue"),C(I))}function C(I){return I===null||Ie(I)?(e.exit("codeFlowValue"),T(I)):(e.consume(I),C)}function L(I){return e.exit("codeFenced"),n(I)}function G(I,R,X){let U=0;return D;function D(q){return I.enter("lineEnding"),I.consume(q),I.exit("lineEnding"),Q}function Q(q){return I.enter("codeFencedFence"),rt(q)?ut(I,M,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):M(q)}function M(q){return q===f?(I.enter("codeFencedFenceSequence"),V(q)):X(q)}function V(q){return q===f?(U++,I.consume(q),V):U>=d?(I.exit("codeFencedFenceSequence"),rt(q)?ut(I,H,"whitespace")(q):H(q)):X(q)}function H(q){return q===null||Ie(q)?(I.exit("codeFencedFence"),R(q)):X(q)}}}function iE(e,n,l){const i=this;return s;function s(d){return d===null?l(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return i.parser.lazy[i.now().line]?l(d):n(d)}}const jf={name:"codeIndented",tokenize:sE},aE={partial:!0,tokenize:oE};function sE(e,n,l){const i=this;return s;function s(m){return e.enter("codeIndented"),ut(e,c,"linePrefix",5)(m)}function c(m){const x=i.events[i.events.length-1];return x&&x[1].type==="linePrefix"&&x[2].sliceSerialize(x[1],!0).length>=4?d(m):l(m)}function d(m){return m===null?p(m):Ie(m)?e.attempt(aE,d,p)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||Ie(m)?(e.exit("codeFlowValue"),d(m)):(e.consume(m),f)}function p(m){return e.exit("codeIndented"),n(m)}}function oE(e,n,l){const i=this;return s;function s(d){return i.parser.lazy[i.now().line]?l(d):Ie(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),s):ut(e,c,"linePrefix",5)(d)}function c(d){const f=i.events[i.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(d):Ie(d)?s(d):l(d)}}const cE={name:"codeText",previous:dE,resolve:uE,tokenize:fE};function uE(e){let n=e.length-4,l=3,i,s;if((e[l][1].type==="lineEnding"||e[l][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(i=l;++i<n;)if(e[i][1].type==="codeTextData"){e[l][1].type="codeTextPadding",e[n][1].type="codeTextPadding",l+=2,n-=2;break}}for(i=l-1,n++;++i<=n;)s===void 0?i!==n&&e[i][1].type!=="lineEnding"&&(s=i):(i===n||e[i][1].type==="lineEnding")&&(e[s][1].type="codeTextData",i!==s+2&&(e[s][1].end=e[i-1][1].end,e.splice(s+2,i-s-2),n-=i-s-2,i=s+2),s=void 0);return e}function dE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function fE(e,n,l){let i=0,s,c;return d;function d(b){return e.enter("codeText"),e.enter("codeTextSequence"),f(b)}function f(b){return b===96?(e.consume(b),i++,f):(e.exit("codeTextSequence"),p(b))}function p(b){return b===null?l(b):b===32?(e.enter("space"),e.consume(b),e.exit("space"),p):b===96?(c=e.enter("codeTextSequence"),s=0,x(b)):Ie(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("codeTextData"),m(b))}function m(b){return b===null||b===32||b===96||Ie(b)?(e.exit("codeTextData"),p(b)):(e.consume(b),m)}function x(b){return b===96?(e.consume(b),s++,x):s===i?(e.exit("codeTextSequence"),e.exit("codeText"),n(b)):(c.type="codeTextData",m(b))}}class mE{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,l){const i=l??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(n,i):n>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(n,l,i){const s=l||0;this.setCursor(Math.trunc(n));const c=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return i&&ds(this.left,i),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),ds(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),ds(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const l=this.left.splice(n,Number.POSITIVE_INFINITY);ds(this.right,l.reverse())}else{const l=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);ds(this.left,l.reverse())}}}function ds(e,n){let l=0;if(n.length<1e4)e.push(...n);else for(;l<n.length;)e.push(...n.slice(l,l+1e4)),l+=1e4}function $v(e){const n={};let l=-1,i,s,c,d,f,p,m;const x=new mE(e);for(;++l<x.length;){for(;l in n;)l=n[l];if(i=x.get(l),l&&i[1].type==="chunkFlow"&&x.get(l-1)[1].type==="listItemPrefix"&&(p=i[1]._tokenizer.events,c=0,c<p.length&&p[c][1].type==="lineEndingBlank"&&(c+=2),c<p.length&&p[c][1].type==="content"))for(;++c<p.length&&p[c][1].type!=="content";)p[c][1].type==="chunkText"&&(p[c][1]._isInFirstContentOfListItem=!0,c++);if(i[0]==="enter")i[1].contentType&&(Object.assign(n,pE(x,l)),l=n[l],m=!0);else if(i[1]._container){for(c=l,s=void 0;c--;)if(d=x.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(s&&(x.get(s)[1].type="lineEndingBlank"),d[1].type="lineEnding",s=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;s&&(i[1].end={...x.get(s)[1].start},f=x.slice(s,l),f.unshift(i),x.splice(s,l-s+1,f))}}return Kn(e,0,Number.POSITIVE_INFINITY,x.slice(0)),!m}function pE(e,n){const l=e.get(n)[1],i=e.get(n)[2];let s=n-1;const c=[];let d=l._tokenizer;d||(d=i.parser[l.contentType](l.start),l._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const f=d.events,p=[],m={};let x,b,y=-1,v=l,w=0,N=0;const j=[N];for(;v;){for(;e.get(++s)[1]!==v;);c.push(s),v._tokenizer||(x=i.sliceStream(v),v.next||x.push(null),b&&d.defineSkip(v.start),v._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(x),v._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),b=v,v=v.next}for(v=l;++y<f.length;)f[y][0]==="exit"&&f[y-1][0]==="enter"&&f[y][1].type===f[y-1][1].type&&f[y][1].start.line!==f[y][1].end.line&&(N=y+1,j.push(N),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(d.events=[],v?(v._tokenizer=void 0,v.previous=void 0):j.pop(),y=j.length;y--;){const k=f.slice(j[y],j[y+1]),T=c.pop();p.push([T,T+k.length-1]),e.splice(T,2,k)}for(p.reverse(),y=-1;++y<p.length;)m[w+p[y][0]]=w+p[y][1],w+=p[y][1]-p[y][0]-1;return m}const hE={resolve:xE,tokenize:bE},gE={partial:!0,tokenize:yE};function xE(e){return $v(e),e}function bE(e,n){let l;return i;function i(f){return e.enter("content"),l=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?c(f):Ie(f)?e.check(gE,d,c)(f):(e.consume(f),s)}function c(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function d(f){return e.consume(f),e.exit("chunkContent"),l.next=e.enter("chunkContent",{contentType:"content",previous:l}),l=l.next,s}}function yE(e,n,l){const i=this;return s;function s(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ut(e,c,"linePrefix")}function c(d){if(d===null||Ie(d))return l(d);const f=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(d):e.interrupt(i.parser.constructs.flow,l,n)(d)}}function Gv(e,n,l,i,s,c,d,f,p){const m=p||Number.POSITIVE_INFINITY;let x=0;return b;function b(k){return k===60?(e.enter(i),e.enter(s),e.enter(c),e.consume(k),e.exit(c),y):k===null||k===32||k===41||Sc(k)?l(k):(e.enter(i),e.enter(d),e.enter(f),e.enter("chunkString",{contentType:"string"}),N(k))}function y(k){return k===62?(e.enter(c),e.consume(k),e.exit(c),e.exit(s),e.exit(i),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(f),y(k)):k===null||k===60||Ie(k)?l(k):(e.consume(k),k===92?w:v)}function w(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function N(k){return!x&&(k===null||k===41||Ct(k))?(e.exit("chunkString"),e.exit(f),e.exit(d),e.exit(i),n(k)):x<m&&k===40?(e.consume(k),x++,N):k===41?(e.consume(k),x--,N):k===null||k===32||k===40||Sc(k)?l(k):(e.consume(k),k===92?j:N)}function j(k){return k===40||k===41||k===92?(e.consume(k),N):N(k)}}function qv(e,n,l,i,s,c){const d=this;let f=0,p;return m;function m(v){return e.enter(i),e.enter(s),e.consume(v),e.exit(s),e.enter(c),x}function x(v){return f>999||v===null||v===91||v===93&&!p||v===94&&!f&&"_hiddenFootnoteSupport"in d.parser.constructs?l(v):v===93?(e.exit(c),e.enter(s),e.consume(v),e.exit(s),e.exit(i),n):Ie(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),x):(e.enter("chunkString",{contentType:"string"}),b(v))}function b(v){return v===null||v===91||v===93||Ie(v)||f++>999?(e.exit("chunkString"),x(v)):(e.consume(v),p||(p=!rt(v)),v===92?y:b)}function y(v){return v===91||v===92||v===93?(e.consume(v),f++,b):b(v)}}function Vv(e,n,l,i,s,c){let d;return f;function f(y){return y===34||y===39||y===40?(e.enter(i),e.enter(s),e.consume(y),e.exit(s),d=y===40?41:y,p):l(y)}function p(y){return y===d?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),n):(e.enter(c),m(y))}function m(y){return y===d?(e.exit(c),p(d)):y===null?l(y):Ie(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),ut(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),x(y))}function x(y){return y===d||y===null||Ie(y)?(e.exit("chunkString"),m(y)):(e.consume(y),y===92?b:x)}function b(y){return y===d||y===92?(e.consume(y),x):x(y)}}function bs(e,n){let l;return i;function i(s){return Ie(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),l=!0,i):rt(s)?ut(e,i,l?"linePrefix":"lineSuffix")(s):n(s)}}const vE={name:"definition",tokenize:wE},SE={partial:!0,tokenize:kE};function wE(e,n,l){const i=this;let s;return c;function c(v){return e.enter("definition"),d(v)}function d(v){return qv.call(i,e,f,l,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return s=gr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),p):l(v)}function p(v){return Ct(v)?bs(e,m)(v):m(v)}function m(v){return Gv(e,x,l,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function x(v){return e.attempt(SE,b,b)(v)}function b(v){return rt(v)?ut(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Ie(v)?(e.exit("definition"),i.parser.defined.push(s),n(v)):l(v)}}function kE(e,n,l){return i;function i(f){return Ct(f)?bs(e,s)(f):l(f)}function s(f){return Vv(e,c,l,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function c(f){return rt(f)?ut(e,d,"whitespace")(f):d(f)}function d(f){return f===null||Ie(f)?n(f):l(f)}}const jE={name:"hardBreakEscape",tokenize:NE};function NE(e,n,l){return i;function i(c){return e.enter("hardBreakEscape"),e.consume(c),s}function s(c){return Ie(c)?(e.exit("hardBreakEscape"),n(c)):l(c)}}const CE={name:"headingAtx",resolve:EE,tokenize:TE};function EE(e,n){let l=e.length-2,i=3,s,c;return e[i][1].type==="whitespace"&&(i+=2),l-2>i&&e[l][1].type==="whitespace"&&(l-=2),e[l][1].type==="atxHeadingSequence"&&(i===l-1||l-4>i&&e[l-2][1].type==="whitespace")&&(l-=i+1===l?2:4),l>i&&(s={type:"atxHeadingText",start:e[i][1].start,end:e[l][1].end},c={type:"chunkText",start:e[i][1].start,end:e[l][1].end,contentType:"text"},Kn(e,i,l-i+1,[["enter",s,n],["enter",c,n],["exit",c,n],["exit",s,n]])),e}function TE(e,n,l){let i=0;return s;function s(x){return e.enter("atxHeading"),c(x)}function c(x){return e.enter("atxHeadingSequence"),d(x)}function d(x){return x===35&&i++<6?(e.consume(x),d):x===null||Ct(x)?(e.exit("atxHeadingSequence"),f(x)):l(x)}function f(x){return x===35?(e.enter("atxHeadingSequence"),p(x)):x===null||Ie(x)?(e.exit("atxHeading"),n(x)):rt(x)?ut(e,f,"whitespace")(x):(e.enter("atxHeadingText"),m(x))}function p(x){return x===35?(e.consume(x),p):(e.exit("atxHeadingSequence"),f(x))}function m(x){return x===null||x===35||Ct(x)?(e.exit("atxHeadingText"),f(x)):(e.consume(x),m)}}const AE=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Oy=["pre","script","style","textarea"],OE={concrete:!0,name:"htmlFlow",resolveTo:ME,tokenize:zE},_E={partial:!0,tokenize:LE},RE={partial:!0,tokenize:DE};function ME(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function zE(e,n,l){const i=this;let s,c,d,f,p;return m;function m(O){return x(O)}function x(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),b}function b(O){return O===33?(e.consume(O),y):O===47?(e.consume(O),c=!0,N):O===63?(e.consume(O),s=3,i.interrupt?n:A):Cn(O)?(e.consume(O),d=String.fromCharCode(O),j):l(O)}function y(O){return O===45?(e.consume(O),s=2,v):O===91?(e.consume(O),s=5,f=0,w):Cn(O)?(e.consume(O),s=4,i.interrupt?n:A):l(O)}function v(O){return O===45?(e.consume(O),i.interrupt?n:A):l(O)}function w(O){const $="CDATA[";return O===$.charCodeAt(f++)?(e.consume(O),f===$.length?i.interrupt?n:M:w):l(O)}function N(O){return Cn(O)?(e.consume(O),d=String.fromCharCode(O),j):l(O)}function j(O){if(O===null||O===47||O===62||Ct(O)){const $=O===47,ee=d.toLowerCase();return!$&&!c&&Oy.includes(ee)?(s=1,i.interrupt?n(O):M(O)):AE.includes(d.toLowerCase())?(s=6,$?(e.consume(O),k):i.interrupt?n(O):M(O)):(s=7,i.interrupt&&!i.parser.lazy[i.now().line]?l(O):c?T(O):C(O))}return O===45||Sn(O)?(e.consume(O),d+=String.fromCharCode(O),j):l(O)}function k(O){return O===62?(e.consume(O),i.interrupt?n:M):l(O)}function T(O){return rt(O)?(e.consume(O),T):D(O)}function C(O){return O===47?(e.consume(O),D):O===58||O===95||Cn(O)?(e.consume(O),L):rt(O)?(e.consume(O),C):D(O)}function L(O){return O===45||O===46||O===58||O===95||Sn(O)?(e.consume(O),L):G(O)}function G(O){return O===61?(e.consume(O),I):rt(O)?(e.consume(O),G):C(O)}function I(O){return O===null||O===60||O===61||O===62||O===96?l(O):O===34||O===39?(e.consume(O),p=O,R):rt(O)?(e.consume(O),I):X(O)}function R(O){return O===p?(e.consume(O),p=null,U):O===null||Ie(O)?l(O):(e.consume(O),R)}function X(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Ct(O)?G(O):(e.consume(O),X)}function U(O){return O===47||O===62||rt(O)?C(O):l(O)}function D(O){return O===62?(e.consume(O),Q):l(O)}function Q(O){return O===null||Ie(O)?M(O):rt(O)?(e.consume(O),Q):l(O)}function M(O){return O===45&&s===2?(e.consume(O),B):O===60&&s===1?(e.consume(O),P):O===62&&s===4?(e.consume(O),z):O===63&&s===3?(e.consume(O),A):O===93&&s===5?(e.consume(O),ae):Ie(O)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(_E,W,V)(O)):O===null||Ie(O)?(e.exit("htmlFlowData"),V(O)):(e.consume(O),M)}function V(O){return e.check(RE,H,W)(O)}function H(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),q}function q(O){return O===null||Ie(O)?V(O):(e.enter("htmlFlowData"),M(O))}function B(O){return O===45?(e.consume(O),A):M(O)}function P(O){return O===47?(e.consume(O),d="",oe):M(O)}function oe(O){if(O===62){const $=d.toLowerCase();return Oy.includes($)?(e.consume(O),z):M(O)}return Cn(O)&&d.length<8?(e.consume(O),d+=String.fromCharCode(O),oe):M(O)}function ae(O){return O===93?(e.consume(O),A):M(O)}function A(O){return O===62?(e.consume(O),z):O===45&&s===2?(e.consume(O),A):M(O)}function z(O){return O===null||Ie(O)?(e.exit("htmlFlowData"),W(O)):(e.consume(O),z)}function W(O){return e.exit("htmlFlow"),n(O)}}function DE(e,n,l){const i=this;return s;function s(d){return Ie(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):l(d)}function c(d){return i.parser.lazy[i.now().line]?l(d):n(d)}}function LE(e,n,l){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Us,n,l)}}const IE={name:"htmlText",tokenize:BE};function BE(e,n,l){const i=this;let s,c,d;return f;function f(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),p}function p(A){return A===33?(e.consume(A),m):A===47?(e.consume(A),G):A===63?(e.consume(A),C):Cn(A)?(e.consume(A),X):l(A)}function m(A){return A===45?(e.consume(A),x):A===91?(e.consume(A),c=0,w):Cn(A)?(e.consume(A),T):l(A)}function x(A){return A===45?(e.consume(A),v):l(A)}function b(A){return A===null?l(A):A===45?(e.consume(A),y):Ie(A)?(d=b,P(A)):(e.consume(A),b)}function y(A){return A===45?(e.consume(A),v):b(A)}function v(A){return A===62?B(A):A===45?y(A):b(A)}function w(A){const z="CDATA[";return A===z.charCodeAt(c++)?(e.consume(A),c===z.length?N:w):l(A)}function N(A){return A===null?l(A):A===93?(e.consume(A),j):Ie(A)?(d=N,P(A)):(e.consume(A),N)}function j(A){return A===93?(e.consume(A),k):N(A)}function k(A){return A===62?B(A):A===93?(e.consume(A),k):N(A)}function T(A){return A===null||A===62?B(A):Ie(A)?(d=T,P(A)):(e.consume(A),T)}function C(A){return A===null?l(A):A===63?(e.consume(A),L):Ie(A)?(d=C,P(A)):(e.consume(A),C)}function L(A){return A===62?B(A):C(A)}function G(A){return Cn(A)?(e.consume(A),I):l(A)}function I(A){return A===45||Sn(A)?(e.consume(A),I):R(A)}function R(A){return Ie(A)?(d=R,P(A)):rt(A)?(e.consume(A),R):B(A)}function X(A){return A===45||Sn(A)?(e.consume(A),X):A===47||A===62||Ct(A)?U(A):l(A)}function U(A){return A===47?(e.consume(A),B):A===58||A===95||Cn(A)?(e.consume(A),D):Ie(A)?(d=U,P(A)):rt(A)?(e.consume(A),U):B(A)}function D(A){return A===45||A===46||A===58||A===95||Sn(A)?(e.consume(A),D):Q(A)}function Q(A){return A===61?(e.consume(A),M):Ie(A)?(d=Q,P(A)):rt(A)?(e.consume(A),Q):U(A)}function M(A){return A===null||A===60||A===61||A===62||A===96?l(A):A===34||A===39?(e.consume(A),s=A,V):Ie(A)?(d=M,P(A)):rt(A)?(e.consume(A),M):(e.consume(A),H)}function V(A){return A===s?(e.consume(A),s=void 0,q):A===null?l(A):Ie(A)?(d=V,P(A)):(e.consume(A),V)}function H(A){return A===null||A===34||A===39||A===60||A===61||A===96?l(A):A===47||A===62||Ct(A)?U(A):(e.consume(A),H)}function q(A){return A===47||A===62||Ct(A)?U(A):l(A)}function B(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),n):l(A)}function P(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),oe}function oe(A){return rt(A)?ut(e,ae,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):ae(A)}function ae(A){return e.enter("htmlTextData"),d(A)}}const Dm={name:"labelEnd",resolveAll:$E,resolveTo:GE,tokenize:qE},HE={tokenize:VE},UE={tokenize:YE},FE={tokenize:XE};function $E(e){let n=-1;const l=[];for(;++n<e.length;){const i=e[n][1];if(l.push(e[n]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const s=i.type==="labelImage"?4:2;i.type="data",n+=s}}return e.length!==l.length&&Kn(e,0,e.length,l),e}function GE(e,n){let l=e.length,i=0,s,c,d,f;for(;l--;)if(s=e[l][1],c){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[l][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(d){if(e[l][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(c=l,s.type!=="labelLink")){i=2;break}}else s.type==="labelEnd"&&(d=l);const p={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},x={type:"labelText",start:{...e[c+i+2][1].end},end:{...e[d-2][1].start}};return f=[["enter",p,n],["enter",m,n]],f=or(f,e.slice(c+1,c+i+3)),f=or(f,[["enter",x,n]]),f=or(f,zc(n.parser.constructs.insideSpan.null,e.slice(c+i+4,d-3),n)),f=or(f,[["exit",x,n],e[d-2],e[d-1],["exit",m,n]]),f=or(f,e.slice(d+1)),f=or(f,[["exit",p,n]]),Kn(e,c,e.length,f),e}function qE(e,n,l){const i=this;let s=i.events.length,c,d;for(;s--;)if((i.events[s][1].type==="labelImage"||i.events[s][1].type==="labelLink")&&!i.events[s][1]._balanced){c=i.events[s][1];break}return f;function f(y){return c?c._inactive?b(y):(d=i.parser.defined.includes(gr(i.sliceSerialize({start:c.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),p):l(y)}function p(y){return y===40?e.attempt(HE,x,d?x:b)(y):y===91?e.attempt(UE,x,d?m:b)(y):d?x(y):b(y)}function m(y){return e.attempt(FE,x,b)(y)}function x(y){return n(y)}function b(y){return c._balanced=!0,l(y)}}function VE(e,n,l){return i;function i(b){return e.enter("resource"),e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),s}function s(b){return Ct(b)?bs(e,c)(b):c(b)}function c(b){return b===41?x(b):Gv(e,d,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function d(b){return Ct(b)?bs(e,p)(b):x(b)}function f(b){return l(b)}function p(b){return b===34||b===39||b===40?Vv(e,m,l,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):x(b)}function m(b){return Ct(b)?bs(e,x)(b):x(b)}function x(b){return b===41?(e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),e.exit("resource"),n):l(b)}}function YE(e,n,l){const i=this;return s;function s(f){return qv.call(i,e,c,d,"reference","referenceMarker","referenceString")(f)}function c(f){return i.parser.defined.includes(gr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?n(f):l(f)}function d(f){return l(f)}}function XE(e,n,l){return i;function i(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),s}function s(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),n):l(c)}}const PE={name:"labelStartImage",resolveAll:Dm.resolveAll,tokenize:QE};function QE(e,n,l){const i=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),c}function c(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),d):l(f)}function d(f){return f===94&&"_hiddenFootnoteSupport"in i.parser.constructs?l(f):n(f)}}const ZE={name:"labelStartLink",resolveAll:Dm.resolveAll,tokenize:KE};function KE(e,n,l){const i=this;return s;function s(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),c}function c(d){return d===94&&"_hiddenFootnoteSupport"in i.parser.constructs?l(d):n(d)}}const Nf={name:"lineEnding",tokenize:WE};function WE(e,n){return l;function l(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),ut(e,n,"linePrefix")}}const mc={name:"thematicBreak",tokenize:JE};function JE(e,n,l){let i=0,s;return c;function c(m){return e.enter("thematicBreak"),d(m)}function d(m){return s=m,f(m)}function f(m){return m===s?(e.enter("thematicBreakSequence"),p(m)):i>=3&&(m===null||Ie(m))?(e.exit("thematicBreak"),n(m)):l(m)}function p(m){return m===s?(e.consume(m),i++,p):(e.exit("thematicBreakSequence"),rt(m)?ut(e,f,"whitespace")(m):f(m))}}const Dn={continuation:{tokenize:rT},exit:iT,name:"list",tokenize:nT},eT={partial:!0,tokenize:aT},tT={partial:!0,tokenize:lT};function nT(e,n,l){const i=this,s=i.events[i.events.length-1];let c=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,d=0;return f;function f(v){const w=i.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!i.containerState.marker||v===i.containerState.marker:Jf(v)){if(i.containerState.type||(i.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(mc,l,m)(v):m(v);if(!i.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(v)}return l(v)}function p(v){return Jf(v)&&++d<10?(e.consume(v),p):(!i.interrupt||d<2)&&(i.containerState.marker?v===i.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),m(v)):l(v)}function m(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||v,e.check(Us,i.interrupt?l:x,e.attempt(eT,y,b))}function x(v){return i.containerState.initialBlankLine=!0,c++,y(v)}function b(v){return rt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):l(v)}function y(v){return i.containerState.size=c+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(v)}}function rT(e,n,l){const i=this;return i.containerState._closeFlow=void 0,e.check(Us,s,c);function s(f){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,ut(e,n,"listItemIndent",i.containerState.size+1)(f)}function c(f){return i.containerState.furtherBlankLines||!rt(f)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,d(f)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(tT,n,d)(f))}function d(f){return i.containerState._closeFlow=!0,i.interrupt=void 0,ut(e,e.attempt(Dn,n,l),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function lT(e,n,l){const i=this;return ut(e,s,"listItemIndent",i.containerState.size+1);function s(c){const d=i.events[i.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===i.containerState.size?n(c):l(c)}}function iT(e){e.exit(this.containerState.type)}function aT(e,n,l){const i=this;return ut(e,s,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(c){const d=i.events[i.events.length-1];return!rt(c)&&d&&d[1].type==="listItemPrefixWhitespace"?n(c):l(c)}}const _y={name:"setextUnderline",resolveTo:sT,tokenize:oT};function sT(e,n){let l=e.length,i,s,c;for(;l--;)if(e[l][0]==="enter"){if(e[l][1].type==="content"){i=l;break}e[l][1].type==="paragraph"&&(s=l)}else e[l][1].type==="content"&&e.splice(l,1),!c&&e[l][1].type==="definition"&&(c=l);const d={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",c?(e.splice(s,0,["enter",d,n]),e.splice(c+1,0,["exit",e[i][1],n]),e[i][1].end={...e[c][1].end}):e[i][1]=d,e.push(["exit",d,n]),e}function oT(e,n,l){const i=this;let s;return c;function c(m){let x=i.events.length,b;for(;x--;)if(i.events[x][1].type!=="lineEnding"&&i.events[x][1].type!=="linePrefix"&&i.events[x][1].type!=="content"){b=i.events[x][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||b)?(e.enter("setextHeadingLine"),s=m,d(m)):l(m)}function d(m){return e.enter("setextHeadingLineSequence"),f(m)}function f(m){return m===s?(e.consume(m),f):(e.exit("setextHeadingLineSequence"),rt(m)?ut(e,p,"lineSuffix")(m):p(m))}function p(m){return m===null||Ie(m)?(e.exit("setextHeadingLine"),n(m)):l(m)}}const cT={tokenize:uT};function uT(e){const n=this,l=e.attempt(Us,i,e.attempt(this.parser.constructs.flowInitial,s,ut(e,e.attempt(this.parser.constructs.flow,s,e.attempt(hE,s)),"linePrefix")));return l;function i(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),n.currentConstruct=void 0,l}function s(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),n.currentConstruct=void 0,l}}const dT={resolveAll:Xv()},fT=Yv("string"),mT=Yv("text");function Yv(e){return{resolveAll:Xv(e==="text"?pT:void 0),tokenize:n};function n(l){const i=this,s=this.parser.constructs[e],c=l.attempt(s,d,f);return d;function d(x){return m(x)?c(x):f(x)}function f(x){if(x===null){l.consume(x);return}return l.enter("data"),l.consume(x),p}function p(x){return m(x)?(l.exit("data"),c(x)):(l.consume(x),p)}function m(x){if(x===null)return!0;const b=s[x];let y=-1;if(b)for(;++y<b.length;){const v=b[y];if(!v.previous||v.previous.call(i,i.previous))return!0}return!1}}}function Xv(e){return n;function n(l,i){let s=-1,c;for(;++s<=l.length;)c===void 0?l[s]&&l[s][1].type==="data"&&(c=s,s++):(!l[s]||l[s][1].type!=="data")&&(s!==c+2&&(l[c][1].end=l[s-1][1].end,l.splice(c+2,s-c-2),s=c+2),c=void 0);return e?e(l,i):l}}function pT(e,n){let l=0;for(;++l<=e.length;)if((l===e.length||e[l][1].type==="lineEnding")&&e[l-1][1].type==="data"){const i=e[l-1][1],s=n.sliceStream(i);let c=s.length,d=-1,f=0,p;for(;c--;){const m=s[c];if(typeof m=="string"){for(d=m.length;m.charCodeAt(d-1)===32;)f++,d--;if(d)break;d=-1}else if(m===-2)p=!0,f++;else if(m!==-1){c++;break}}if(n._contentTypeTextTrailing&&l===e.length&&(f=0),f){const m={type:l===e.length||p||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:i.start._bufferIndex+d,_index:i.start._index+c,line:i.end.line,column:i.end.column-f,offset:i.end.offset-f},end:{...i.end}};i.end={...m.start},i.start.offset===i.end.offset?Object.assign(i,m):(e.splice(l,0,["enter",m,n],["exit",m,n]),l+=2)}l++}return e}const hT={42:Dn,43:Dn,45:Dn,48:Dn,49:Dn,50:Dn,51:Dn,52:Dn,53:Dn,54:Dn,55:Dn,56:Dn,57:Dn,62:Hv},gT={91:vE},xT={[-2]:jf,[-1]:jf,32:jf},bT={35:CE,42:mc,45:[_y,mc],60:OE,61:_y,95:mc,96:Ay,126:Ay},yT={38:Fv,92:Uv},vT={[-5]:Nf,[-4]:Nf,[-3]:Nf,33:PE,38:Fv,42:em,60:[ZC,IE],91:ZE,92:[jE,Uv],93:Dm,95:em,96:cE},ST={null:[em,dT]},wT={null:[42,95]},kT={null:[]},jT=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:wT,contentInitial:gT,disable:kT,document:hT,flow:bT,flowInitial:xT,insideSpan:ST,string:yT,text:vT},Symbol.toStringTag,{value:"Module"}));function NT(e,n,l){let i={_bufferIndex:-1,_index:0,line:l&&l.line||1,column:l&&l.column||1,offset:l&&l.offset||0};const s={},c=[];let d=[],f=[];const p={attempt:R(G),check:R(I),consume:T,enter:C,exit:L,interrupt:R(I,{interrupt:!0})},m={code:null,containerState:{},defineSkip:N,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:b};let x=n.tokenize.call(m,p);return n.resolveAll&&c.push(n),m;function b(Q){return d=or(d,Q),j(),d[d.length-1]!==null?[]:(X(n,0),m.events=zc(c,m.events,m),m.events)}function y(Q,M){return ET(v(Q),M)}function v(Q){return CT(d,Q)}function w(){const{_bufferIndex:Q,_index:M,line:V,column:H,offset:q}=i;return{_bufferIndex:Q,_index:M,line:V,column:H,offset:q}}function N(Q){s[Q.line]=Q.column,D()}function j(){let Q;for(;i._index<d.length;){const M=d[i._index];if(typeof M=="string")for(Q=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===Q&&i._bufferIndex<M.length;)k(M.charCodeAt(i._bufferIndex));else k(M)}}function k(Q){x=x(Q)}function T(Q){Ie(Q)?(i.line++,i.column=1,i.offset+=Q===-3?2:1,D()):Q!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===d[i._index].length&&(i._bufferIndex=-1,i._index++)),m.previous=Q}function C(Q,M){const V=M||{};return V.type=Q,V.start=w(),m.events.push(["enter",V,m]),f.push(V),V}function L(Q){const M=f.pop();return M.end=w(),m.events.push(["exit",M,m]),M}function G(Q,M){X(Q,M.from)}function I(Q,M){M.restore()}function R(Q,M){return V;function V(H,q,B){let P,oe,ae,A;return Array.isArray(H)?W(H):"tokenize"in H?W([H]):z(H);function z(re){return Y;function Y(le){const xe=le!==null&&re[le],Te=le!==null&&re.null,je=[...Array.isArray(xe)?xe:xe?[xe]:[],...Array.isArray(Te)?Te:Te?[Te]:[]];return W(je)(le)}}function W(re){return P=re,oe=0,re.length===0?B:O(re[oe])}function O(re){return Y;function Y(le){return A=U(),ae=re,re.partial||(m.currentConstruct=re),re.name&&m.parser.constructs.disable.null.includes(re.name)?ee():re.tokenize.call(M?Object.assign(Object.create(m),M):m,p,$,ee)(le)}}function $(re){return Q(ae,A),q}function ee(re){return A.restore(),++oe<P.length?O(P[oe]):B}}}function X(Q,M){Q.resolveAll&&!c.includes(Q)&&c.push(Q),Q.resolve&&Kn(m.events,M,m.events.length-M,Q.resolve(m.events.slice(M),m)),Q.resolveTo&&(m.events=Q.resolveTo(m.events,m))}function U(){const Q=w(),M=m.previous,V=m.currentConstruct,H=m.events.length,q=Array.from(f);return{from:H,restore:B};function B(){i=Q,m.previous=M,m.currentConstruct=V,m.events.length=H,f=q,D()}}function D(){i.line in s&&i.column<2&&(i.column=s[i.line],i.offset+=s[i.line]-1)}}function CT(e,n){const l=n.start._index,i=n.start._bufferIndex,s=n.end._index,c=n.end._bufferIndex;let d;if(l===s)d=[e[l].slice(i,c)];else{if(d=e.slice(l,s),i>-1){const f=d[0];typeof f=="string"?d[0]=f.slice(i):d.shift()}c>0&&d.push(e[s].slice(0,c))}return d}function ET(e,n){let l=-1;const i=[];let s;for(;++l<e.length;){const c=e[l];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
72
- `;break}case-3:{d=`\r
73
- `;break}case-2:{d=n?" ":" ";break}case-1:{if(!n&&s)continue;d=" ";break}default:d=String.fromCharCode(c)}s=c===-2,i.push(d)}return i.join("")}function TT(e){const i={constructs:Iv([jT,...(e||{}).extensions||[]]),content:s(GC),defined:[],document:s(VC),flow:s(cT),lazy:{},string:s(fT),text:s(mT)};return i;function s(c){return d;function d(f){return NT(i,c,f)}}}function AT(e){for(;!$v(e););return e}const Ry=/[\0\t\n\r]/g;function OT(){let e=1,n="",l=!0,i;return s;function s(c,d,f){const p=[];let m,x,b,y,v;for(c=n+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),b=0,n="",l&&(c.charCodeAt(0)===65279&&b++,l=void 0);b<c.length;){if(Ry.lastIndex=b,m=Ry.exec(c),y=m&&m.index!==void 0?m.index:c.length,v=c.charCodeAt(y),!m){n=c.slice(b);break}if(v===10&&b===y&&i)p.push(-3),i=void 0;else switch(i&&(p.push(-5),i=void 0),b<y&&(p.push(c.slice(b,y)),e+=y-b),v){case 0:{p.push(65533),e++;break}case 9:{for(x=Math.ceil(e/4)*4,p.push(-2);e++<x;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:i=!0,e=1}b=y+1}return f&&(i&&p.push(-5),n&&p.push(n),p.push(null)),p}}const _T=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function RT(e){return e.replace(_T,MT)}function MT(e,n,l){if(n)return n;if(l.charCodeAt(0)===35){const s=l.charCodeAt(1),c=s===120||s===88;return Bv(l.slice(c?2:1),c?16:10)}return Os(l)||e}const Pv={}.hasOwnProperty;function zT(e,n,l){return n&&typeof n=="object"&&(l=n,n=void 0),DT(l)(AT(TT(l).document().write(OT()(e,n,!0))))}function DT(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(vt),autolinkProtocol:U,autolinkEmail:U,atxHeading:c(Re),blockQuote:c(Te),characterEscape:U,characterReference:U,codeFenced:c(je),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(je,d),codeText:c(He,d),codeTextData:U,data:U,codeFlowValue:U,definition:c(fe),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(Ce),hardBreakEscape:c($e),hardBreakTrailing:c($e),htmlFlow:c(Je,d),htmlFlowData:U,htmlText:c(Je,d),htmlTextData:U,image:c(Ge),label:d,link:c(vt),listItem:c(Gt),listItemValue:y,listOrdered:c(Tt,b),listUnordered:c(Tt),paragraph:c(en),reference:O,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(Re),strong:c(At),thematicBreak:c(kn)},exit:{atxHeading:p(),atxHeadingSequence:G,autolink:p(),autolinkEmail:xe,autolinkProtocol:le,blockQuote:p(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:re,characterReference:Y,codeFenced:p(j),codeFencedFence:N,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:D,codeIndented:p(k),codeText:p(q),codeTextData:D,data:D,definition:p(),definitionDestinationString:L,definitionLabelString:T,definitionTitleString:C,emphasis:p(),hardBreakEscape:p(M),hardBreakTrailing:p(M),htmlFlow:p(V),htmlFlowData:D,htmlText:p(H),htmlTextData:D,image:p(P),label:ae,labelText:oe,lineEnding:Q,link:p(B),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:$,resourceDestinationString:A,resourceTitleString:z,resource:W,setextHeading:p(X),setextHeadingLineSequence:R,setextHeadingText:I,strong:p(),thematicBreak:p()}};Qv(n,(e||{}).mdastExtensions||[]);const l={};return i;function i(ce){let ve={type:"root",children:[]};const Me={stack:[ve],tokenStack:[],config:n,enter:f,exit:m,buffer:d,resume:x,data:l},K=[];let Se=-1;for(;++Se<ce.length;)if(ce[Se][1].type==="listOrdered"||ce[Se][1].type==="listUnordered")if(ce[Se][0]==="enter")K.push(Se);else{const De=K.pop();Se=s(ce,De,Se)}for(Se=-1;++Se<ce.length;){const De=n[ce[Se][0]];Pv.call(De,ce[Se][1].type)&&De[ce[Se][1].type].call(Object.assign({sliceSerialize:ce[Se][2].sliceSerialize},Me),ce[Se][1])}if(Me.tokenStack.length>0){const De=Me.tokenStack[Me.tokenStack.length-1];(De[1]||My).call(Me,void 0,De[0])}for(ve.position={start:jl(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:jl(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},Se=-1;++Se<n.transforms.length;)ve=n.transforms[Se](ve)||ve;return ve}function s(ce,ve,Me){let K=ve-1,Se=-1,De=!1,Xe,Qe,ue,ge;for(;++K<=Me;){const we=ce[K];switch(we[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{we[0]==="enter"?Se++:Se--,ge=void 0;break}case"lineEndingBlank":{we[0]==="enter"&&(Xe&&!ge&&!Se&&!ue&&(ue=K),ge=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ge=void 0}if(!Se&&we[0]==="enter"&&we[1].type==="listItemPrefix"||Se===-1&&we[0]==="exit"&&(we[1].type==="listUnordered"||we[1].type==="listOrdered")){if(Xe){let Le=K;for(Qe=void 0;Le--;){const qe=ce[Le];if(qe[1].type==="lineEnding"||qe[1].type==="lineEndingBlank"){if(qe[0]==="exit")continue;Qe&&(ce[Qe][1].type="lineEndingBlank",De=!0),qe[1].type="lineEnding",Qe=Le}else if(!(qe[1].type==="linePrefix"||qe[1].type==="blockQuotePrefix"||qe[1].type==="blockQuotePrefixWhitespace"||qe[1].type==="blockQuoteMarker"||qe[1].type==="listItemIndent"))break}ue&&(!Qe||ue<Qe)&&(Xe._spread=!0),Xe.end=Object.assign({},Qe?ce[Qe][1].start:we[1].end),ce.splice(Qe||K,0,["exit",Xe,we[2]]),K++,Me++}if(we[1].type==="listItemPrefix"){const Le={type:"listItem",_spread:!1,start:Object.assign({},we[1].start),end:void 0};Xe=Le,ce.splice(K,0,["enter",Le,we[2]]),K++,Me++,ue=void 0,ge=!0}}}return ce[ve][1]._spread=De,Me}function c(ce,ve){return Me;function Me(K){f.call(this,ce(K),K),ve&&ve.call(this,K)}}function d(){this.stack.push({type:"fragment",children:[]})}function f(ce,ve,Me){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([ve,Me||void 0]),ce.position={start:jl(ve.start),end:void 0}}function p(ce){return ve;function ve(Me){ce&&ce.call(this,Me),m.call(this,Me)}}function m(ce,ve){const Me=this.stack.pop(),K=this.tokenStack.pop();if(K)K[0].type!==ce.type&&(ve?ve.call(this,ce,K[0]):(K[1]||My).call(this,ce,K[0]));else throw new Error("Cannot close `"+ce.type+"` ("+xs({start:ce.start,end:ce.end})+"): it’s not open");Me.position.end=jl(ce.end)}function x(){return zm(this.stack.pop())}function b(){this.data.expectingFirstListItemValue=!0}function y(ce){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=ce}function w(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=ce}function N(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce.replace(/(\r?\n|\r)$/g,"")}function T(ce){const ve=this.resume(),Me=this.stack[this.stack.length-1];Me.label=ve,Me.identifier=gr(this.sliceSerialize(ce)).toLowerCase()}function C(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ce}function L(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ce}function G(ce){const ve=this.stack[this.stack.length-1];if(!ve.depth){const Me=this.sliceSerialize(ce).length;ve.depth=Me}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function R(ce){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function X(){this.data.setextHeadingSlurpLineEnding=void 0}function U(ce){const Me=this.stack[this.stack.length-1].children;let K=Me[Me.length-1];(!K||K.type!=="text")&&(K=Ot(),K.position={start:jl(ce.start),end:void 0},Me.push(K)),this.stack.push(K)}function D(ce){const ve=this.stack.pop();ve.value+=this.sliceSerialize(ce),ve.position.end=jl(ce.end)}function Q(ce){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=ve.children[ve.children.length-1];Me.position.end=jl(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(ve.type)&&(U.call(this,ce),D.call(this,ce))}function M(){this.data.atHardBreak=!0}function V(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce}function H(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce}function q(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce}function B(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=ve,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function P(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=ve,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function oe(ce){const ve=this.sliceSerialize(ce),Me=this.stack[this.stack.length-2];Me.label=RT(ve),Me.identifier=gr(ve).toLowerCase()}function ae(){const ce=this.stack[this.stack.length-1],ve=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const K=ce.children;Me.children=K}else Me.alt=ve}function A(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ce}function z(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ce}function W(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function $(ce){const ve=this.resume(),Me=this.stack[this.stack.length-1];Me.label=ve,Me.identifier=gr(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function ee(ce){this.data.characterReferenceType=ce.type}function re(ce){const ve=this.sliceSerialize(ce),Me=this.data.characterReferenceType;let K;Me?(K=Bv(ve,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):K=Os(ve);const Se=this.stack[this.stack.length-1];Se.value+=K}function Y(ce){const ve=this.stack.pop();ve.position.end=jl(ce.end)}function le(ce){D.call(this,ce);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(ce)}function xe(ce){D.call(this,ce);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(ce)}function Te(){return{type:"blockquote",children:[]}}function je(){return{type:"code",lang:null,meta:null,value:""}}function He(){return{type:"inlineCode",value:""}}function fe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ce(){return{type:"emphasis",children:[]}}function Re(){return{type:"heading",depth:0,children:[]}}function $e(){return{type:"break"}}function Je(){return{type:"html",value:""}}function Ge(){return{type:"image",title:null,url:"",alt:null}}function vt(){return{type:"link",title:null,url:"",children:[]}}function Tt(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function Gt(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function en(){return{type:"paragraph",children:[]}}function At(){return{type:"strong",children:[]}}function Ot(){return{type:"text",value:""}}function kn(){return{type:"thematicBreak"}}}function jl(e){return{line:e.line,column:e.column,offset:e.offset}}function Qv(e,n){let l=-1;for(;++l<n.length;){const i=n[l];Array.isArray(i)?Qv(e,i):LT(e,i)}}function LT(e,n){let l;for(l in n)if(Pv.call(n,l))switch(l){case"canContainEols":{const i=n[l];i&&e[l].push(...i);break}case"transforms":{const i=n[l];i&&e[l].push(...i);break}case"enter":case"exit":{const i=n[l];i&&Object.assign(e[l],i);break}}}function My(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+xs({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+xs({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+xs({start:n.start,end:n.end})+") is still open")}function IT(e){const n=this;n.parser=l;function l(i){return zT(i,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function BT(e,n){const l={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,l),e.applyData(n,l)}function HT(e,n){const l={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,l),[e.applyData(n,l),{type:"text",value:`
74
- `}]}function UT(e,n){const l=n.value?n.value+`
75
- `:"",i={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(i.className=["language-"+s[0]]);let c={type:"element",tagName:"code",properties:i,children:[{type:"text",value:l}]};return n.meta&&(c.data={meta:n.meta}),e.patch(n,c),c=e.applyData(n,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(n,c),c}function FT(e,n){const l={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function $T(e,n){const l={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function GT(e,n){const l=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(n.identifier).toUpperCase(),s=ma(i.toLowerCase()),c=e.footnoteOrder.indexOf(i);let d,f=e.footnoteCounts.get(i);f===void 0?(f=0,e.footnoteOrder.push(i),d=e.footnoteOrder.length):d=c+1,f+=1,e.footnoteCounts.set(i,f);const p={type:"element",tagName:"a",properties:{href:"#"+l+"fn-"+s,id:l+"fnref-"+s+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(n,p);const m={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(n,m),e.applyData(n,m)}function qT(e,n){const l={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function VT(e,n){if(e.options.allowDangerousHtml){const l={type:"raw",value:n.value};return e.patch(n,l),e.applyData(n,l)}}function Zv(e,n){const l=n.referenceType;let i="]";if(l==="collapsed"?i+="[]":l==="full"&&(i+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+i}];const s=e.all(n),c=s[0];c&&c.type==="text"?c.value="["+c.value:s.unshift({type:"text",value:"["});const d=s[s.length-1];return d&&d.type==="text"?d.value+=i:s.push({type:"text",value:i}),s}function YT(e,n){const l=String(n.identifier).toUpperCase(),i=e.definitionById.get(l);if(!i)return Zv(e,n);const s={src:ma(i.url||""),alt:n.alt};i.title!==null&&i.title!==void 0&&(s.title=i.title);const c={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,c),e.applyData(n,c)}function XT(e,n){const l={src:ma(n.url)};n.alt!==null&&n.alt!==void 0&&(l.alt=n.alt),n.title!==null&&n.title!==void 0&&(l.title=n.title);const i={type:"element",tagName:"img",properties:l,children:[]};return e.patch(n,i),e.applyData(n,i)}function PT(e,n){const l={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,l);const i={type:"element",tagName:"code",properties:{},children:[l]};return e.patch(n,i),e.applyData(n,i)}function QT(e,n){const l=String(n.identifier).toUpperCase(),i=e.definitionById.get(l);if(!i)return Zv(e,n);const s={href:ma(i.url||"")};i.title!==null&&i.title!==void 0&&(s.title=i.title);const c={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,c),e.applyData(n,c)}function ZT(e,n){const l={href:ma(n.url)};n.title!==null&&n.title!==void 0&&(l.title=n.title);const i={type:"element",tagName:"a",properties:l,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function KT(e,n,l){const i=e.all(n),s=l?WT(l):Kv(n),c={},d=[];if(typeof n.checked=="boolean"){const x=i[0];let b;x&&x.type==="element"&&x.tagName==="p"?b=x:(b={type:"element",tagName:"p",properties:{},children:[]},i.unshift(b)),b.children.length>0&&b.children.unshift({type:"text",value:" "}),b.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let f=-1;for(;++f<i.length;){const x=i[f];(s||f!==0||x.type!=="element"||x.tagName!=="p")&&d.push({type:"text",value:`
76
- `}),x.type==="element"&&x.tagName==="p"&&!s?d.push(...x.children):d.push(x)}const p=i[i.length-1];p&&(s||p.type!=="element"||p.tagName!=="p")&&d.push({type:"text",value:`
77
- `});const m={type:"element",tagName:"li",properties:c,children:d};return e.patch(n,m),e.applyData(n,m)}function WT(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const l=e.children;let i=-1;for(;!n&&++i<l.length;)n=Kv(l[i])}return n}function Kv(e){const n=e.spread;return n??e.children.length>1}function JT(e,n){const l={},i=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(l.start=n.start);++s<i.length;){const d=i[s];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){l.className=["contains-task-list"];break}}const c={type:"element",tagName:n.ordered?"ol":"ul",properties:l,children:e.wrap(i,!0)};return e.patch(n,c),e.applyData(n,c)}function eA(e,n){const l={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function tA(e,n){const l={type:"root",children:e.wrap(e.all(n))};return e.patch(n,l),e.applyData(n,l)}function nA(e,n){const l={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function rA(e,n){const l=e.all(n),i=l.shift(),s=[];if(i){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(n.children[0],d),s.push(d)}if(l.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(l,!0)},f=Om(n.children[1]),p=Ov(n.children[n.children.length-1]);f&&p&&(d.position={start:f,end:p}),s.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,c),e.applyData(n,c)}function lA(e,n,l){const i=l?l.children:void 0,c=(i?i.indexOf(n):1)===0?"th":"td",d=l&&l.type==="table"?l.align:void 0,f=d?d.length:n.children.length;let p=-1;const m=[];for(;++p<f;){const b=n.children[p],y={},v=d?d[p]:void 0;v&&(y.align=v);let w={type:"element",tagName:c,properties:y,children:[]};b&&(w.children=e.all(b),e.patch(b,w),w=e.applyData(b,w)),m.push(w)}const x={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(n,x),e.applyData(n,x)}function iA(e,n){const l={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}const zy=9,Dy=32;function aA(e){const n=String(e),l=/\r?\n|\r/g;let i=l.exec(n),s=0;const c=[];for(;i;)c.push(Ly(n.slice(s,i.index),s>0,!0),i[0]),s=i.index+i[0].length,i=l.exec(n);return c.push(Ly(n.slice(s),s>0,!1)),c.join("")}function Ly(e,n,l){let i=0,s=e.length;if(n){let c=e.codePointAt(i);for(;c===zy||c===Dy;)i++,c=e.codePointAt(i)}if(l){let c=e.codePointAt(s-1);for(;c===zy||c===Dy;)s--,c=e.codePointAt(s-1)}return s>i?e.slice(i,s):""}function sA(e,n){const l={type:"text",value:aA(String(n.value))};return e.patch(n,l),e.applyData(n,l)}function oA(e,n){const l={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,l),e.applyData(n,l)}const cA={blockquote:BT,break:HT,code:UT,delete:FT,emphasis:$T,footnoteReference:GT,heading:qT,html:VT,imageReference:YT,image:XT,inlineCode:PT,linkReference:QT,link:ZT,listItem:KT,list:JT,paragraph:eA,root:tA,strong:nA,table:rA,tableCell:iA,tableRow:lA,text:sA,thematicBreak:oA,toml:ic,yaml:ic,definition:ic,footnoteDefinition:ic};function ic(){}const Wv=-1,Dc=0,ys=1,wc=2,Lm=3,Im=4,Bm=5,Hm=6,Jv=7,e1=8,Iy=typeof self=="object"?self:globalThis,uA=(e,n)=>{const l=(s,c)=>(e.set(c,s),s),i=s=>{if(e.has(s))return e.get(s);const[c,d]=n[s];switch(c){case Dc:case Wv:return l(d,s);case ys:{const f=l([],s);for(const p of d)f.push(i(p));return f}case wc:{const f=l({},s);for(const[p,m]of d)f[i(p)]=i(m);return f}case Lm:return l(new Date(d),s);case Im:{const{source:f,flags:p}=d;return l(new RegExp(f,p),s)}case Bm:{const f=l(new Map,s);for(const[p,m]of d)f.set(i(p),i(m));return f}case Hm:{const f=l(new Set,s);for(const p of d)f.add(i(p));return f}case Jv:{const{name:f,message:p}=d;return l(new Iy[f](p),s)}case e1:return l(BigInt(d),s);case"BigInt":return l(Object(BigInt(d)),s);case"ArrayBuffer":return l(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:f}=new Uint8Array(d);return l(new DataView(f),d)}}return l(new Iy[c](d),s)};return i},By=e=>uA(new Map,e)(0),ea="",{toString:dA}={},{keys:fA}=Object,fs=e=>{const n=typeof e;if(n!=="object"||!e)return[Dc,n];const l=dA.call(e).slice(8,-1);switch(l){case"Array":return[ys,ea];case"Object":return[wc,ea];case"Date":return[Lm,ea];case"RegExp":return[Im,ea];case"Map":return[Bm,ea];case"Set":return[Hm,ea];case"DataView":return[ys,l]}return l.includes("Array")?[ys,l]:l.includes("Error")?[Jv,l]:[wc,l]},ac=([e,n])=>e===Dc&&(n==="function"||n==="symbol"),mA=(e,n,l,i)=>{const s=(d,f)=>{const p=i.push(d)-1;return l.set(f,p),p},c=d=>{if(l.has(d))return l.get(d);let[f,p]=fs(d);switch(f){case Dc:{let x=d;switch(p){case"bigint":f=e1,x=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);x=null;break;case"undefined":return s([Wv],d)}return s([f,x],d)}case ys:{if(p){let y=d;return p==="DataView"?y=new Uint8Array(d.buffer):p==="ArrayBuffer"&&(y=new Uint8Array(d)),s([p,[...y]],d)}const x=[],b=s([f,x],d);for(const y of d)x.push(c(y));return b}case wc:{if(p)switch(p){case"BigInt":return s([p,d.toString()],d);case"Boolean":case"Number":case"String":return s([p,d.valueOf()],d)}if(n&&"toJSON"in d)return c(d.toJSON());const x=[],b=s([f,x],d);for(const y of fA(d))(e||!ac(fs(d[y])))&&x.push([c(y),c(d[y])]);return b}case Lm:return s([f,d.toISOString()],d);case Im:{const{source:x,flags:b}=d;return s([f,{source:x,flags:b}],d)}case Bm:{const x=[],b=s([f,x],d);for(const[y,v]of d)(e||!(ac(fs(y))||ac(fs(v))))&&x.push([c(y),c(v)]);return b}case Hm:{const x=[],b=s([f,x],d);for(const y of d)(e||!ac(fs(y)))&&x.push(c(y));return b}}const{message:m}=d;return s([f,{name:p,message:m}],d)};return c},Hy=(e,{json:n,lossy:l}={})=>{const i=[];return mA(!(n||l),!!n,new Map,i)(e),i},kc=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?By(Hy(e,n)):structuredClone(e):(e,n)=>By(Hy(e,n));function pA(e,n){const l=[{type:"text",value:"↩"}];return n>1&&l.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),l}function hA(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function gA(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=e.options.footnoteBackContent||pA,i=e.options.footnoteBackLabel||hA,s=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let p=-1;for(;++p<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[p]);if(!m)continue;const x=e.all(m),b=String(m.identifier).toUpperCase(),y=ma(b.toLowerCase());let v=0;const w=[],N=e.footnoteCounts.get(b);for(;N!==void 0&&++v<=N;){w.length>0&&w.push({type:"text",value:" "});let T=typeof l=="string"?l:l(p,v);typeof T=="string"&&(T={type:"text",value:T}),w.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(p,v),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const j=x[x.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const T=j.children[j.children.length-1];T&&T.type==="text"?T.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...w)}else x.push(...w);const k={type:"element",tagName:"li",properties:{id:n+"fn-"+y},children:e.wrap(x,!0)};e.patch(m,k),f.push(k)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...kc(d),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
78
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
79
- `}]}}const Lc=(function(e){if(e==null)return vA;if(typeof e=="function")return Ic(e);if(typeof e=="object")return Array.isArray(e)?xA(e):bA(e);if(typeof e=="string")return yA(e);throw new Error("Expected function, string, or object as test")});function xA(e){const n=[];let l=-1;for(;++l<e.length;)n[l]=Lc(e[l]);return Ic(i);function i(...s){let c=-1;for(;++c<n.length;)if(n[c].apply(this,s))return!0;return!1}}function bA(e){const n=e;return Ic(l);function l(i){const s=i;let c;for(c in e)if(s[c]!==n[c])return!1;return!0}}function yA(e){return Ic(n);function n(l){return l&&l.type===e}}function Ic(e){return n;function n(l,i,s){return!!(SA(l)&&e.call(this,l,typeof i=="number"?i:void 0,s||void 0))}}function vA(){return!0}function SA(e){return e!==null&&typeof e=="object"&&"type"in e}const t1=[],wA=!0,tm=!1,kA="skip";function n1(e,n,l,i){let s;typeof n=="function"&&typeof l!="function"?(i=l,l=n):s=n;const c=Lc(s),d=i?-1:1;f(e,void 0,[])();function f(p,m,x){const b=p&&typeof p=="object"?p:{};if(typeof b.type=="string"){const v=typeof b.tagName=="string"?b.tagName:typeof b.name=="string"?b.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(p.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=t1,w,N,j;if((!n||c(p,m,x[x.length-1]||void 0))&&(v=jA(l(p,x)),v[0]===tm))return v;if("children"in p&&p.children){const k=p;if(k.children&&v[0]!==kA)for(N=(i?k.children.length:-1)+d,j=x.concat(k);N>-1&&N<k.children.length;){const T=k.children[N];if(w=f(T,N,j)(),w[0]===tm)return w;N=typeof w[1]=="number"?w[1]:N+d}}return v}}}function jA(e){return Array.isArray(e)?e:typeof e=="number"?[wA,e]:e==null?t1:[e]}function Um(e,n,l,i){let s,c,d;typeof n=="function"&&typeof l!="function"?(c=void 0,d=n,s=l):(c=n,d=l,s=i),n1(e,c,f,s);function f(p,m){const x=m[m.length-1],b=x?x.children.indexOf(p):void 0;return d(p,b,x)}}const nm={}.hasOwnProperty,NA={};function CA(e,n){const l=n||NA,i=new Map,s=new Map,c=new Map,d={...cA,...l.handlers},f={all:m,applyData:TA,definitionById:i,footnoteById:s,footnoteCounts:c,footnoteOrder:[],handlers:d,one:p,options:l,patch:EA,wrap:OA};return Um(e,function(x){if(x.type==="definition"||x.type==="footnoteDefinition"){const b=x.type==="definition"?i:s,y=String(x.identifier).toUpperCase();b.has(y)||b.set(y,x)}}),f;function p(x,b){const y=x.type,v=f.handlers[y];if(nm.call(f.handlers,y)&&v)return v(f,x,b);if(f.options.passThrough&&f.options.passThrough.includes(y)){if("children"in x){const{children:N,...j}=x,k=kc(j);return k.children=f.all(x),k}return kc(x)}return(f.options.unknownHandler||AA)(f,x,b)}function m(x){const b=[];if("children"in x){const y=x.children;let v=-1;for(;++v<y.length;){const w=f.one(y[v],x);if(w){if(v&&y[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=Uy(w.value)),!Array.isArray(w)&&w.type==="element")){const N=w.children[0];N&&N.type==="text"&&(N.value=Uy(N.value))}Array.isArray(w)?b.push(...w):b.push(w)}}}return b}}function EA(e,n){e.position&&(n.position=hC(e))}function TA(e,n){let l=n;if(e&&e.data){const i=e.data.hName,s=e.data.hChildren,c=e.data.hProperties;if(typeof i=="string")if(l.type==="element")l.tagName=i;else{const d="children"in l?l.children:[l];l={type:"element",tagName:i,properties:{},children:d}}l.type==="element"&&c&&Object.assign(l.properties,kc(c)),"children"in l&&l.children&&s!==null&&s!==void 0&&(l.children=s)}return l}function AA(e,n){const l=n.data||{},i="value"in n&&!(nm.call(l,"hProperties")||nm.call(l,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function OA(e,n){const l=[];let i=-1;for(n&&l.push({type:"text",value:`
80
- `});++i<e.length;)i&&l.push({type:"text",value:`
81
- `}),l.push(e[i]);return n&&e.length>0&&l.push({type:"text",value:`
82
- `}),l}function Uy(e){let n=0,l=e.charCodeAt(n);for(;l===9||l===32;)n++,l=e.charCodeAt(n);return e.slice(n)}function Fy(e,n){const l=CA(e,n),i=l.one(e,void 0),s=gA(l),c=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return s&&c.children.push({type:"text",value:`
83
- `},s),c}function _A(e,n){return e&&"run"in e?async function(l,i){const s=Fy(l,{file:i,...n});await e.run(s,i)}:function(l,i){return Fy(l,{file:i,...e||n})}}function $y(e){if(e)throw e}var Cf,Gy;function RA(){if(Gy)return Cf;Gy=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,l=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=function(m){return typeof Array.isArray=="function"?Array.isArray(m):n.call(m)==="[object Array]"},c=function(m){if(!m||n.call(m)!=="[object Object]")return!1;var x=e.call(m,"constructor"),b=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!x&&!b)return!1;var y;for(y in m);return typeof y>"u"||e.call(m,y)},d=function(m,x){l&&x.name==="__proto__"?l(m,x.name,{enumerable:!0,configurable:!0,value:x.newValue,writable:!0}):m[x.name]=x.newValue},f=function(m,x){if(x==="__proto__")if(e.call(m,x)){if(i)return i(m,x).value}else return;return m[x]};return Cf=function p(){var m,x,b,y,v,w,N=arguments[0],j=1,k=arguments.length,T=!1;for(typeof N=="boolean"&&(T=N,N=arguments[1]||{},j=2),(N==null||typeof N!="object"&&typeof N!="function")&&(N={});j<k;++j)if(m=arguments[j],m!=null)for(x in m)b=f(N,x),y=f(m,x),N!==y&&(T&&y&&(c(y)||(v=s(y)))?(v?(v=!1,w=b&&s(b)?b:[]):w=b&&c(b)?b:{},d(N,{name:x,newValue:p(T,w,y)})):typeof y<"u"&&d(N,{name:x,newValue:y}));return N},Cf}var MA=RA();const Ef=zs(MA);function rm(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function zA(){const e=[],n={run:l,use:i};return n;function l(...s){let c=-1;const d=s.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);f(null,...s);function f(p,...m){const x=e[++c];let b=-1;if(p){d(p);return}for(;++b<s.length;)(m[b]===null||m[b]===void 0)&&(m[b]=s[b]);s=m,x?DA(x,f)(...m):d(null,...m)}}function i(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),n}}function DA(e,n){let l;return i;function i(...d){const f=e.length>d.length;let p;f&&d.push(s);try{p=e.apply(this,d)}catch(m){const x=m;if(f&&l)throw x;return s(x)}f||(p&&p.then&&typeof p.then=="function"?p.then(c,s):p instanceof Error?s(p):c(p))}function s(d,...f){l||(l=!0,n(d,...f))}function c(d){s(null,d)}}const wr={basename:LA,dirname:IA,extname:BA,join:HA,sep:"/"};function LA(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Fs(e);let l=0,i=-1,s=e.length,c;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(c){l=s+1;break}}else i<0&&(c=!0,i=s+1);return i<0?"":e.slice(l,i)}if(n===e)return"";let d=-1,f=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(c){l=s+1;break}}else d<0&&(c=!0,d=s+1),f>-1&&(e.codePointAt(s)===n.codePointAt(f--)?f<0&&(i=s):(f=-1,i=d));return l===i?i=d:i<0&&(i=e.length),e.slice(l,i)}function IA(e){if(Fs(e),e.length===0)return".";let n=-1,l=e.length,i;for(;--l;)if(e.codePointAt(l)===47){if(i){n=l;break}}else i||(i=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function BA(e){Fs(e);let n=e.length,l=-1,i=0,s=-1,c=0,d;for(;n--;){const f=e.codePointAt(n);if(f===47){if(d){i=n+1;break}continue}l<0&&(d=!0,l=n+1),f===46?s<0?s=n:c!==1&&(c=1):s>-1&&(c=-1)}return s<0||l<0||c===0||c===1&&s===l-1&&s===i+1?"":e.slice(s,l)}function HA(...e){let n=-1,l;for(;++n<e.length;)Fs(e[n]),e[n]&&(l=l===void 0?e[n]:l+"/"+e[n]);return l===void 0?".":UA(l)}function UA(e){Fs(e);const n=e.codePointAt(0)===47;let l=FA(e,!n);return l.length===0&&!n&&(l="."),l.length>0&&e.codePointAt(e.length-1)===47&&(l+="/"),n?"/"+l:l}function FA(e,n){let l="",i=0,s=-1,c=0,d=-1,f,p;for(;++d<=e.length;){if(d<e.length)f=e.codePointAt(d);else{if(f===47)break;f=47}if(f===47){if(!(s===d-1||c===1))if(s!==d-1&&c===2){if(l.length<2||i!==2||l.codePointAt(l.length-1)!==46||l.codePointAt(l.length-2)!==46){if(l.length>2){if(p=l.lastIndexOf("/"),p!==l.length-1){p<0?(l="",i=0):(l=l.slice(0,p),i=l.length-1-l.lastIndexOf("/")),s=d,c=0;continue}}else if(l.length>0){l="",i=0,s=d,c=0;continue}}n&&(l=l.length>0?l+"/..":"..",i=2)}else l.length>0?l+="/"+e.slice(s+1,d):l=e.slice(s+1,d),i=d-s-1;s=d,c=0}else f===46&&c>-1?c++:c=-1}return l}function Fs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const $A={cwd:GA};function GA(){return"/"}function lm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function qA(e){if(typeof e=="string")e=new URL(e);else if(!lm(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return VA(e)}function VA(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const n=e.pathname;let l=-1;for(;++l<n.length;)if(n.codePointAt(l)===37&&n.codePointAt(l+1)===50){const i=n.codePointAt(l+2);if(i===70||i===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(n)}const Tf=["history","path","basename","stem","extname","dirname"];class r1{constructor(n){let l;n?lm(n)?l={path:n}:typeof n=="string"||YA(n)?l={value:n}:l=n:l={},this.cwd="cwd"in l?"":$A.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Tf.length;){const c=Tf[i];c in l&&l[c]!==void 0&&l[c]!==null&&(this[c]=c==="history"?[...l[c]]:l[c])}let s;for(s in l)Tf.includes(s)||(this[s]=l[s])}get basename(){return typeof this.path=="string"?wr.basename(this.path):void 0}set basename(n){Of(n,"basename"),Af(n,"basename"),this.path=wr.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?wr.dirname(this.path):void 0}set dirname(n){qy(this.basename,"dirname"),this.path=wr.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?wr.extname(this.path):void 0}set extname(n){if(Af(n,"extname"),qy(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=wr.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){lm(n)&&(n=qA(n)),Of(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?wr.basename(this.path,this.extname):void 0}set stem(n){Of(n,"stem"),Af(n,"stem"),this.path=wr.join(this.dirname||"",n+(this.extname||""))}fail(n,l,i){const s=this.message(n,l,i);throw s.fatal=!0,s}info(n,l,i){const s=this.message(n,l,i);return s.fatal=void 0,s}message(n,l,i){const s=new wn(n,l,i);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function Af(e,n){if(e&&e.includes(wr.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+wr.sep+"`")}function Of(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function qy(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function YA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const XA=(function(e){const i=this.constructor.prototype,s=i[e],c=function(){return s.apply(c,arguments)};return Object.setPrototypeOf(c,i),c}),PA={}.hasOwnProperty;class Fm extends XA{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=zA()}copy(){const n=new Fm;let l=-1;for(;++l<this.attachers.length;){const i=this.attachers[l];n.use(...i)}return n.data(Ef(!0,{},this.namespace)),n}data(n,l){return typeof n=="string"?arguments.length===2?(Mf("data",this.frozen),this.namespace[n]=l,this):PA.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Mf("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[l,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const s=l.call(n,...i);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const l=sc(n),i=this.parser||this.Parser;return _f("parse",i),i(String(l),l)}process(n,l){const i=this;return this.freeze(),_f("process",this.parser||this.Parser),Rf("process",this.compiler||this.Compiler),l?s(void 0,l):new Promise(s);function s(c,d){const f=sc(n),p=i.parse(f);i.run(p,f,function(x,b,y){if(x||!b||!y)return m(x);const v=b,w=i.stringify(v,y);KA(w)?y.value=w:y.result=w,m(x,y)});function m(x,b){x||!b?d(x):c?c(b):l(void 0,b)}}}processSync(n){let l=!1,i;return this.freeze(),_f("processSync",this.parser||this.Parser),Rf("processSync",this.compiler||this.Compiler),this.process(n,s),Yy("processSync","process",l),i;function s(c,d){l=!0,$y(c),i=d}}run(n,l,i){Vy(n),this.freeze();const s=this.transformers;return!i&&typeof l=="function"&&(i=l,l=void 0),i?c(void 0,i):new Promise(c);function c(d,f){const p=sc(l);s.run(n,p,m);function m(x,b,y){const v=b||n;x?f(x):d?d(v):i(void 0,v,y)}}}runSync(n,l){let i=!1,s;return this.run(n,l,c),Yy("runSync","run",i),s;function c(d,f){$y(d),s=f,i=!0}}stringify(n,l){this.freeze();const i=sc(l),s=this.compiler||this.Compiler;return Rf("stringify",s),Vy(n),s(n,i)}use(n,...l){const i=this.attachers,s=this.namespace;if(Mf("use",this.frozen),n!=null)if(typeof n=="function")p(n,l);else if(typeof n=="object")Array.isArray(n)?f(n):d(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function c(m){if(typeof m=="function")p(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[x,...b]=m;p(x,b)}else d(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function d(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(m.plugins),m.settings&&(s.settings=Ef(!0,s.settings,m.settings))}function f(m){let x=-1;if(m!=null)if(Array.isArray(m))for(;++x<m.length;){const b=m[x];c(b)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function p(m,x){let b=-1,y=-1;for(;++b<i.length;)if(i[b][0]===m){y=b;break}if(y===-1)i.push([m,...x]);else if(x.length>0){let[v,...w]=x;const N=i[y][1];rm(N)&&rm(v)&&(v=Ef(!0,N,v)),i[y]=[m,v,...w]}}}}const QA=new Fm().freeze();function _f(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Rf(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Mf(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Vy(e){if(!rm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Yy(e,n,l){if(!l)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function sc(e){return ZA(e)?e:new r1(e)}function ZA(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function KA(e){return typeof e=="string"||WA(e)}function WA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Xy=[],Py={allowDangerousHtml:!0},e5=/^(https?|ircs?|mailto|xmpp)$/i,t5=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function n5(e){const n=r5(e),l=l5(e);return i5(n.runSync(n.parse(l),l),e)}function r5(e){const n=e.rehypePlugins||Xy,l=e.remarkPlugins||Xy,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Py}:Py;return QA().use(IT).use(l).use(_A,i).use(n)}function l5(e){const n=e.children||"",l=new r1;return typeof n=="string"&&(l.value=n),l}function i5(e,n){const l=n.allowedElements,i=n.allowElement,s=n.components,c=n.disallowedElements,d=n.skipHtml,f=n.unwrapDisallowed,p=n.urlTransform||a5;for(const x of t5)Object.hasOwn(n,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+JA+x.id,void 0);return Um(e,m),vC(e,{Fragment:u.Fragment,components:s,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function m(x,b,y){if(x.type==="raw"&&y&&typeof b=="number")return d?y.children.splice(b,1):y.children[b]={type:"text",value:x.value},b;if(x.type==="element"){let v;for(v in kf)if(Object.hasOwn(kf,v)&&Object.hasOwn(x.properties,v)){const w=x.properties[v],N=kf[v];(N===null||N.includes(x.tagName))&&(x.properties[v]=p(String(w||""),v,x))}}if(x.type==="element"){let v=l?!l.includes(x.tagName):c?c.includes(x.tagName):!1;if(!v&&i&&typeof b=="number"&&(v=!i(x,b,y)),v&&y&&typeof b=="number")return f&&x.children?y.children.splice(b,1,...x.children):y.children.splice(b,1),b}}}function a5(e){const n=e.indexOf(":"),l=e.indexOf("?"),i=e.indexOf("#"),s=e.indexOf("/");return n===-1||s!==-1&&n>s||l!==-1&&n>l||i!==-1&&n>i||e5.test(e.slice(0,n))?e:""}function Qy(e,n){const l=String(e);if(typeof n!="string")throw new TypeError("Expected character");let i=0,s=l.indexOf(n);for(;s!==-1;)i++,s=l.indexOf(n,s+n.length);return i}function s5(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function o5(e,n,l){const s=Lc((l||{}).ignore||[]),c=c5(n);let d=-1;for(;++d<c.length;)n1(e,"text",f);function f(m,x){let b=-1,y;for(;++b<x.length;){const v=x[b],w=y?y.children:void 0;if(s(v,w?w.indexOf(v):void 0,y))return;y=v}if(y)return p(m,x)}function p(m,x){const b=x[x.length-1],y=c[d][0],v=c[d][1];let w=0;const j=b.children.indexOf(m);let k=!1,T=[];y.lastIndex=0;let C=y.exec(m.value);for(;C;){const L=C.index,G={index:C.index,input:C.input,stack:[...x,m]};let I=v(...C,G);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?y.lastIndex=L+1:(w!==L&&T.push({type:"text",value:m.value.slice(w,L)}),Array.isArray(I)?T.push(...I):I&&T.push(I),w=L+C[0].length,k=!0),!y.global)break;C=y.exec(m.value)}return k?(w<m.value.length&&T.push({type:"text",value:m.value.slice(w)}),b.children.splice(j,1,...T)):T=[m],j+T.length}}function c5(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const l=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<l.length;){const s=l[i];n.push([u5(s[0]),d5(s[1])])}return n}function u5(e){return typeof e=="string"?new RegExp(s5(e),"g"):e}function d5(e){return typeof e=="function"?e:function(){return e}}const zf="phrasing",Df=["autolink","link","image","label"];function f5(){return{transforms:[y5],enter:{literalAutolink:p5,literalAutolinkEmail:Lf,literalAutolinkHttp:Lf,literalAutolinkWww:Lf},exit:{literalAutolink:b5,literalAutolinkEmail:x5,literalAutolinkHttp:h5,literalAutolinkWww:g5}}}function m5(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:zf,notInConstruct:Df},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:zf,notInConstruct:Df},{character:":",before:"[ps]",after:"\\/",inConstruct:zf,notInConstruct:Df}]}}function p5(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Lf(e){this.config.enter.autolinkProtocol.call(this,e)}function h5(e){this.config.exit.autolinkProtocol.call(this,e)}function g5(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function x5(e){this.config.exit.autolinkEmail.call(this,e)}function b5(e){this.exit(e)}function y5(e){o5(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,v5],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),S5]],{ignore:["link","linkReference"]})}function v5(e,n,l,i,s){let c="";if(!l1(s)||(/^w/i.test(n)&&(l=n+l,n="",c="http://"),!w5(l)))return!1;const d=k5(l+i);if(!d[0])return!1;const f={type:"link",title:null,url:c+n+d[0],children:[{type:"text",value:n+d[0]}]};return d[1]?[f,{type:"text",value:d[1]}]:f}function S5(e,n,l,i){return!l1(i,!0)||/[-\d_]$/.test(l)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+l,children:[{type:"text",value:n+"@"+l}]}}function w5(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function k5(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let l=n[0],i=l.indexOf(")");const s=Qy(e,"(");let c=Qy(e,")");for(;i!==-1&&s>c;)e+=l.slice(0,i+1),l=l.slice(i+1),i=l.indexOf(")"),c++;return[e,l]}function l1(e,n){const l=e.input.charCodeAt(e.index-1);return(e.index===0||ai(l)||Mc(l))&&(!n||l!==47)}i1.peek=R5;function j5(){this.buffer()}function N5(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function C5(){this.buffer()}function E5(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function T5(e){const n=this.resume(),l=this.stack[this.stack.length-1];l.type,l.identifier=gr(this.sliceSerialize(e)).toLowerCase(),l.label=n}function A5(e){this.exit(e)}function O5(e){const n=this.resume(),l=this.stack[this.stack.length-1];l.type,l.identifier=gr(this.sliceSerialize(e)).toLowerCase(),l.label=n}function _5(e){this.exit(e)}function R5(){return"["}function i1(e,n,l,i){const s=l.createTracker(i);let c=s.move("[^");const d=l.enter("footnoteReference"),f=l.enter("reference");return c+=s.move(l.safe(l.associationId(e),{after:"]",before:c})),f(),d(),c+=s.move("]"),c}function M5(){return{enter:{gfmFootnoteCallString:j5,gfmFootnoteCall:N5,gfmFootnoteDefinitionLabelString:C5,gfmFootnoteDefinition:E5},exit:{gfmFootnoteCallString:T5,gfmFootnoteCall:A5,gfmFootnoteDefinitionLabelString:O5,gfmFootnoteDefinition:_5}}}function z5(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:l,footnoteReference:i1},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function l(i,s,c,d){const f=c.createTracker(d);let p=f.move("[^");const m=c.enter("footnoteDefinition"),x=c.enter("label");return p+=f.move(c.safe(c.associationId(i),{before:p,after:"]"})),x(),p+=f.move("]:"),i.children&&i.children.length>0&&(f.shift(4),p+=f.move((n?`
84
- `:" ")+c.indentLines(c.containerFlow(i,f.current()),n?a1:D5))),m(),p}}function D5(e,n,l){return n===0?e:a1(e,n,l)}function a1(e,n,l){return(l?"":" ")+e}const L5=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];s1.peek=F5;function I5(){return{canContainEols:["delete"],enter:{strikethrough:H5},exit:{strikethrough:U5}}}function B5(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:L5}],handlers:{delete:s1}}}function H5(e){this.enter({type:"delete",children:[]},e)}function U5(e){this.exit(e)}function s1(e,n,l,i){const s=l.createTracker(i),c=l.enter("strikethrough");let d=s.move("~~");return d+=l.containerPhrasing(e,{...s.current(),before:d,after:"~"}),d+=s.move("~~"),c(),d}function F5(){return"~"}function $5(e){return e.length}function G5(e,n){const l=n||{},i=(l.align||[]).concat(),s=l.stringLength||$5,c=[],d=[],f=[],p=[];let m=0,x=-1;for(;++x<e.length;){const N=[],j=[];let k=-1;for(e[x].length>m&&(m=e[x].length);++k<e[x].length;){const T=q5(e[x][k]);if(l.alignDelimiters!==!1){const C=s(T);j[k]=C,(p[k]===void 0||C>p[k])&&(p[k]=C)}N.push(T)}d[x]=N,f[x]=j}let b=-1;if(typeof i=="object"&&"length"in i)for(;++b<m;)c[b]=Zy(i[b]);else{const N=Zy(i);for(;++b<m;)c[b]=N}b=-1;const y=[],v=[];for(;++b<m;){const N=c[b];let j="",k="";N===99?(j=":",k=":"):N===108?j=":":N===114&&(k=":");let T=l.alignDelimiters===!1?1:Math.max(1,p[b]-j.length-k.length);const C=j+"-".repeat(T)+k;l.alignDelimiters!==!1&&(T=j.length+T+k.length,T>p[b]&&(p[b]=T),v[b]=T),y[b]=C}d.splice(1,0,y),f.splice(1,0,v),x=-1;const w=[];for(;++x<d.length;){const N=d[x],j=f[x];b=-1;const k=[];for(;++b<m;){const T=N[b]||"";let C="",L="";if(l.alignDelimiters!==!1){const G=p[b]-(j[b]||0),I=c[b];I===114?C=" ".repeat(G):I===99?G%2?(C=" ".repeat(G/2+.5),L=" ".repeat(G/2-.5)):(C=" ".repeat(G/2),L=C):L=" ".repeat(G)}l.delimiterStart!==!1&&!b&&k.push("|"),l.padding!==!1&&!(l.alignDelimiters===!1&&T==="")&&(l.delimiterStart!==!1||b)&&k.push(" "),l.alignDelimiters!==!1&&k.push(C),k.push(T),l.alignDelimiters!==!1&&k.push(L),l.padding!==!1&&k.push(" "),(l.delimiterEnd!==!1||b!==m-1)&&k.push("|")}w.push(l.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return w.join(`
85
- `)}function q5(e){return e==null?"":String(e)}function Zy(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function V5(e,n,l,i){const s=l.enter("blockquote"),c=l.createTracker(i);c.move("> "),c.shift(2);const d=l.indentLines(l.containerFlow(e,c.current()),Y5);return s(),d}function Y5(e,n,l){return">"+(l?"":" ")+e}function X5(e,n){return Ky(e,n.inConstruct,!0)&&!Ky(e,n.notInConstruct,!1)}function Ky(e,n,l){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return l;let i=-1;for(;++i<n.length;)if(e.includes(n[i]))return!0;return!1}function Wy(e,n,l,i){let s=-1;for(;++s<l.unsafe.length;)if(l.unsafe[s].character===`
86
- `&&X5(l.stack,l.unsafe[s]))return/[ \t]/.test(i.before)?"":" ";return`\\
87
- `}function P5(e,n){const l=String(e);let i=l.indexOf(n),s=i,c=0,d=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===s?++c>d&&(d=c):c=1,s=i+n.length,i=l.indexOf(n,s);return d}function Q5(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Z5(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function K5(e,n,l,i){const s=Z5(l),c=e.value||"",d=s==="`"?"GraveAccent":"Tilde";if(Q5(e,l)){const b=l.enter("codeIndented"),y=l.indentLines(c,W5);return b(),y}const f=l.createTracker(i),p=s.repeat(Math.max(P5(c,s)+1,3)),m=l.enter("codeFenced");let x=f.move(p);if(e.lang){const b=l.enter(`codeFencedLang${d}`);x+=f.move(l.safe(e.lang,{before:x,after:" ",encode:["`"],...f.current()})),b()}if(e.lang&&e.meta){const b=l.enter(`codeFencedMeta${d}`);x+=f.move(" "),x+=f.move(l.safe(e.meta,{before:x,after:`
88
- `,encode:["`"],...f.current()})),b()}return x+=f.move(`
89
- `),c&&(x+=f.move(c+`
90
- `)),x+=f.move(p),m(),x}function W5(e,n,l){return(l?"":" ")+e}function $m(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function J5(e,n,l,i){const s=$m(l),c=s==='"'?"Quote":"Apostrophe",d=l.enter("definition");let f=l.enter("label");const p=l.createTracker(i);let m=p.move("[");return m+=p.move(l.safe(l.associationId(e),{before:m,after:"]",...p.current()})),m+=p.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=l.enter("destinationLiteral"),m+=p.move("<"),m+=p.move(l.safe(e.url,{before:m,after:">",...p.current()})),m+=p.move(">")):(f=l.enter("destinationRaw"),m+=p.move(l.safe(e.url,{before:m,after:e.title?" ":`
91
- `,...p.current()}))),f(),e.title&&(f=l.enter(`title${c}`),m+=p.move(" "+s),m+=p.move(l.safe(e.title,{before:m,after:s,...p.current()})),m+=p.move(s),f()),d(),m}function e3(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function _s(e){return"&#x"+e.toString(16).toUpperCase()+";"}function jc(e,n,l){const i=oa(e),s=oa(n);return i===void 0?s===void 0?l==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}o1.peek=t3;function o1(e,n,l,i){const s=e3(l),c=l.enter("emphasis"),d=l.createTracker(i),f=d.move(s);let p=d.move(l.containerPhrasing(e,{after:s,before:f,...d.current()}));const m=p.charCodeAt(0),x=jc(i.before.charCodeAt(i.before.length-1),m,s);x.inside&&(p=_s(m)+p.slice(1));const b=p.charCodeAt(p.length-1),y=jc(i.after.charCodeAt(0),b,s);y.inside&&(p=p.slice(0,-1)+_s(b));const v=d.move(s);return c(),l.attentionEncodeSurroundingInfo={after:y.outside,before:x.outside},f+p+v}function t3(e,n,l){return l.options.emphasis||"*"}function n3(e,n){let l=!1;return Um(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return l=!0,tm}),!!((!e.depth||e.depth<3)&&zm(e)&&(n.options.setext||l))}function r3(e,n,l,i){const s=Math.max(Math.min(6,e.depth||1),1),c=l.createTracker(i);if(n3(e,l)){const x=l.enter("headingSetext"),b=l.enter("phrasing"),y=l.containerPhrasing(e,{...c.current(),before:`
92
- `,after:`
93
- `});return b(),x(),y+`
94
- `+(s===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
95
- `))+1))}const d="#".repeat(s),f=l.enter("headingAtx"),p=l.enter("phrasing");c.move(d+" ");let m=l.containerPhrasing(e,{before:"# ",after:`
96
- `,...c.current()});return/^[\t ]/.test(m)&&(m=_s(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,l.options.closeAtx&&(m+=" "+d),p(),f(),m}c1.peek=l3;function c1(e){return e.value||""}function l3(){return"<"}u1.peek=i3;function u1(e,n,l,i){const s=$m(l),c=s==='"'?"Quote":"Apostrophe",d=l.enter("image");let f=l.enter("label");const p=l.createTracker(i);let m=p.move("![");return m+=p.move(l.safe(e.alt,{before:m,after:"]",...p.current()})),m+=p.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=l.enter("destinationLiteral"),m+=p.move("<"),m+=p.move(l.safe(e.url,{before:m,after:">",...p.current()})),m+=p.move(">")):(f=l.enter("destinationRaw"),m+=p.move(l.safe(e.url,{before:m,after:e.title?" ":")",...p.current()}))),f(),e.title&&(f=l.enter(`title${c}`),m+=p.move(" "+s),m+=p.move(l.safe(e.title,{before:m,after:s,...p.current()})),m+=p.move(s),f()),m+=p.move(")"),d(),m}function i3(){return"!"}d1.peek=a3;function d1(e,n,l,i){const s=e.referenceType,c=l.enter("imageReference");let d=l.enter("label");const f=l.createTracker(i);let p=f.move("![");const m=l.safe(e.alt,{before:p,after:"]",...f.current()});p+=f.move(m+"]["),d();const x=l.stack;l.stack=[],d=l.enter("reference");const b=l.safe(l.associationId(e),{before:p,after:"]",...f.current()});return d(),l.stack=x,c(),s==="full"||!m||m!==b?p+=f.move(b+"]"):s==="shortcut"?p=p.slice(0,-1):p+=f.move("]"),p}function a3(){return"!"}f1.peek=s3;function f1(e,n,l){let i=e.value||"",s="`",c=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(i);)s+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++c<l.unsafe.length;){const d=l.unsafe[c],f=l.compilePattern(d);let p;if(d.atBreak)for(;p=f.exec(i);){let m=p.index;i.charCodeAt(m)===10&&i.charCodeAt(m-1)===13&&m--,i=i.slice(0,m)+" "+i.slice(p.index+1)}}return s+i+s}function s3(){return"`"}function m1(e,n){const l=zm(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(l===e.url||"mailto:"+l===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}p1.peek=o3;function p1(e,n,l,i){const s=$m(l),c=s==='"'?"Quote":"Apostrophe",d=l.createTracker(i);let f,p;if(m1(e,l)){const x=l.stack;l.stack=[],f=l.enter("autolink");let b=d.move("<");return b+=d.move(l.containerPhrasing(e,{before:b,after:">",...d.current()})),b+=d.move(">"),f(),l.stack=x,b}f=l.enter("link"),p=l.enter("label");let m=d.move("[");return m+=d.move(l.containerPhrasing(e,{before:m,after:"](",...d.current()})),m+=d.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=l.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(l.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(p=l.enter("destinationRaw"),m+=d.move(l.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),p(),e.title&&(p=l.enter(`title${c}`),m+=d.move(" "+s),m+=d.move(l.safe(e.title,{before:m,after:s,...d.current()})),m+=d.move(s),p()),m+=d.move(")"),f(),m}function o3(e,n,l){return m1(e,l)?"<":"["}h1.peek=c3;function h1(e,n,l,i){const s=e.referenceType,c=l.enter("linkReference");let d=l.enter("label");const f=l.createTracker(i);let p=f.move("[");const m=l.containerPhrasing(e,{before:p,after:"]",...f.current()});p+=f.move(m+"]["),d();const x=l.stack;l.stack=[],d=l.enter("reference");const b=l.safe(l.associationId(e),{before:p,after:"]",...f.current()});return d(),l.stack=x,c(),s==="full"||!m||m!==b?p+=f.move(b+"]"):s==="shortcut"?p=p.slice(0,-1):p+=f.move("]"),p}function c3(){return"["}function Gm(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function u3(e){const n=Gm(e),l=e.options.bulletOther;if(!l)return n==="*"?"-":"*";if(l!=="*"&&l!=="+"&&l!=="-")throw new Error("Cannot serialize items with `"+l+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(l===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+l+"`) to be different");return l}function d3(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function g1(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function f3(e,n,l,i){const s=l.enter("list"),c=l.bulletCurrent;let d=e.ordered?d3(l):Gm(l);const f=e.ordered?d==="."?")":".":u3(l);let p=n&&l.bulletLastUsed?d===l.bulletLastUsed:!1;if(!e.ordered){const x=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&x&&(!x.children||!x.children[0])&&l.stack[l.stack.length-1]==="list"&&l.stack[l.stack.length-2]==="listItem"&&l.stack[l.stack.length-3]==="list"&&l.stack[l.stack.length-4]==="listItem"&&l.indexStack[l.indexStack.length-1]===0&&l.indexStack[l.indexStack.length-2]===0&&l.indexStack[l.indexStack.length-3]===0&&(p=!0),g1(l)===d&&x){let b=-1;for(;++b<e.children.length;){const y=e.children[b];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(d=f),l.bulletCurrent=d;const m=l.containerFlow(e,i);return l.bulletLastUsed=d,l.bulletCurrent=c,s(),m}function m3(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function p3(e,n,l,i){const s=m3(l);let c=l.bulletCurrent||Gm(l);n&&n.type==="list"&&n.ordered&&(c=(typeof n.start=="number"&&n.start>-1?n.start:1)+(l.options.incrementListMarker===!1?0:n.children.indexOf(e))+c);let d=c.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(d=Math.ceil(d/4)*4);const f=l.createTracker(i);f.move(c+" ".repeat(d-c.length)),f.shift(d);const p=l.enter("listItem"),m=l.indentLines(l.containerFlow(e,f.current()),x);return p(),m;function x(b,y,v){return y?(v?"":" ".repeat(d))+b:(v?c:c+" ".repeat(d-c.length))+b}}function h3(e,n,l,i){const s=l.enter("paragraph"),c=l.enter("phrasing"),d=l.containerPhrasing(e,i);return c(),s(),d}const g3=Lc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function x3(e,n,l,i){return(e.children.some(function(d){return g3(d)})?l.containerPhrasing:l.containerFlow).call(l,e,i)}function b3(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}x1.peek=y3;function x1(e,n,l,i){const s=b3(l),c=l.enter("strong"),d=l.createTracker(i),f=d.move(s+s);let p=d.move(l.containerPhrasing(e,{after:s,before:f,...d.current()}));const m=p.charCodeAt(0),x=jc(i.before.charCodeAt(i.before.length-1),m,s);x.inside&&(p=_s(m)+p.slice(1));const b=p.charCodeAt(p.length-1),y=jc(i.after.charCodeAt(0),b,s);y.inside&&(p=p.slice(0,-1)+_s(b));const v=d.move(s+s);return c(),l.attentionEncodeSurroundingInfo={after:y.outside,before:x.outside},f+p+v}function y3(e,n,l){return l.options.strong||"*"}function v3(e,n,l,i){return l.safe(e.value,i)}function S3(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function w3(e,n,l){const i=(g1(l)+(l.options.ruleSpaces?" ":"")).repeat(S3(l));return l.options.ruleSpaces?i.slice(0,-1):i}const b1={blockquote:V5,break:Wy,code:K5,definition:J5,emphasis:o1,hardBreak:Wy,heading:r3,html:c1,image:u1,imageReference:d1,inlineCode:f1,link:p1,linkReference:h1,list:f3,listItem:p3,paragraph:h3,root:x3,strong:x1,text:v3,thematicBreak:w3};function k3(){return{enter:{table:j3,tableData:Jy,tableHeader:Jy,tableRow:C3},exit:{codeText:E3,table:N3,tableData:If,tableHeader:If,tableRow:If}}}function j3(e){const n=e._align;this.enter({type:"table",align:n.map(function(l){return l==="none"?null:l}),children:[]},e),this.data.inTable=!0}function N3(e){this.exit(e),this.data.inTable=void 0}function C3(e){this.enter({type:"tableRow",children:[]},e)}function If(e){this.exit(e)}function Jy(e){this.enter({type:"tableCell",children:[]},e)}function E3(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,T3));const l=this.stack[this.stack.length-1];l.type,l.value=n,this.exit(e)}function T3(e,n){return n==="|"?n:e}function A3(e){const n=e||{},l=n.tableCellPadding,i=n.tablePipeAlign,s=n.stringLength,c=l?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
97
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:d,tableCell:p,tableRow:f}};function d(v,w,N,j){return m(x(v,N,j),v.align)}function f(v,w,N,j){const k=b(v,N,j),T=m([k]);return T.slice(0,T.indexOf(`
98
- `))}function p(v,w,N,j){const k=N.enter("tableCell"),T=N.enter("phrasing"),C=N.containerPhrasing(v,{...j,before:c,after:c});return T(),k(),C}function m(v,w){return G5(v,{align:w,alignDelimiters:i,padding:l,stringLength:s})}function x(v,w,N){const j=v.children;let k=-1;const T=[],C=w.enter("table");for(;++k<j.length;)T[k]=b(j[k],w,N);return C(),T}function b(v,w,N){const j=v.children;let k=-1;const T=[],C=w.enter("tableRow");for(;++k<j.length;)T[k]=p(j[k],v,w,N);return C(),T}function y(v,w,N){let j=b1.inlineCode(v,w,N);return N.stack.includes("tableCell")&&(j=j.replace(/\|/g,"\\$&")),j}}function O3(){return{exit:{taskListCheckValueChecked:e0,taskListCheckValueUnchecked:e0,paragraph:R3}}}function _3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:M3}}}function e0(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function R3(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const l=this.stack[this.stack.length-1];l.type;const i=l.children[0];if(i&&i.type==="text"){const s=n.children;let c=-1,d;for(;++c<s.length;){const f=s[c];if(f.type==="paragraph"){d=f;break}}d===l&&(i.value=i.value.slice(1),i.value.length===0?l.children.shift():l.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,l.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function M3(e,n,l,i){const s=e.children[0],c=typeof e.checked=="boolean"&&s&&s.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",f=l.createTracker(i);c&&f.move(d);let p=b1.listItem(e,n,l,{...i,...f.current()});return c&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),p;function m(x){return x+d}}function z3(){return[f5(),M5(),I5(),k3(),O3()]}function D3(e){return{extensions:[m5(),z5(e),B5(),A3(e),_3()]}}const L3={tokenize:$3,partial:!0},y1={tokenize:G3,partial:!0},v1={tokenize:q3,partial:!0},S1={tokenize:V3,partial:!0},I3={tokenize:Y3,partial:!0},w1={name:"wwwAutolink",tokenize:U3,previous:j1},k1={name:"protocolAutolink",tokenize:F3,previous:N1},Wr={name:"emailAutolink",tokenize:H3,previous:C1},Cr={};function B3(){return{text:Cr}}let ei=48;for(;ei<123;)Cr[ei]=Wr,ei++,ei===58?ei=65:ei===91&&(ei=97);Cr[43]=Wr;Cr[45]=Wr;Cr[46]=Wr;Cr[95]=Wr;Cr[72]=[Wr,k1];Cr[104]=[Wr,k1];Cr[87]=[Wr,w1];Cr[119]=[Wr,w1];function H3(e,n,l){const i=this;let s,c;return d;function d(b){return!im(b)||!C1.call(i,i.previous)||qm(i.events)?l(b):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(b))}function f(b){return im(b)?(e.consume(b),f):b===64?(e.consume(b),p):l(b)}function p(b){return b===46?e.check(I3,x,m)(b):b===45||b===95||Sn(b)?(c=!0,e.consume(b),p):x(b)}function m(b){return e.consume(b),s=!0,p}function x(b){return c&&s&&Cn(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(b)):l(b)}}function U3(e,n,l){const i=this;return s;function s(d){return d!==87&&d!==119||!j1.call(i,i.previous)||qm(i.events)?l(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(L3,e.attempt(y1,e.attempt(v1,c),l),l)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(d)}}function F3(e,n,l){const i=this;let s="",c=!1;return d;function d(b){return(b===72||b===104)&&N1.call(i,i.previous)&&!qm(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(b),e.consume(b),f):l(b)}function f(b){if(Cn(b)&&s.length<5)return s+=String.fromCodePoint(b),e.consume(b),f;if(b===58){const y=s.toLowerCase();if(y==="http"||y==="https")return e.consume(b),p}return l(b)}function p(b){return b===47?(e.consume(b),c?m:(c=!0,p)):l(b)}function m(b){return b===null||Sc(b)||Ct(b)||ai(b)||Mc(b)?l(b):e.attempt(y1,e.attempt(v1,x),l)(b)}function x(b){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(b)}}function $3(e,n,l){let i=0;return s;function s(d){return(d===87||d===119)&&i<3?(i++,e.consume(d),s):d===46&&i===3?(e.consume(d),c):l(d)}function c(d){return d===null?l(d):n(d)}}function G3(e,n,l){let i,s,c;return d;function d(m){return m===46||m===95?e.check(S1,p,f)(m):m===null||Ct(m)||ai(m)||m!==45&&Mc(m)?p(m):(c=!0,e.consume(m),d)}function f(m){return m===95?i=!0:(s=i,i=void 0),e.consume(m),d}function p(m){return s||i||!c?l(m):n(m)}}function q3(e,n){let l=0,i=0;return s;function s(d){return d===40?(l++,e.consume(d),s):d===41&&i<l?c(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(S1,n,c)(d):d===null||Ct(d)||ai(d)?n(d):(e.consume(d),s)}function c(d){return d===41&&i++,e.consume(d),s}}function V3(e,n,l){return i;function i(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),i):f===38?(e.consume(f),c):f===93?(e.consume(f),s):f===60||f===null||Ct(f)||ai(f)?n(f):l(f)}function s(f){return f===null||f===40||f===91||Ct(f)||ai(f)?n(f):i(f)}function c(f){return Cn(f)?d(f):l(f)}function d(f){return f===59?(e.consume(f),i):Cn(f)?(e.consume(f),d):l(f)}}function Y3(e,n,l){return i;function i(c){return e.consume(c),s}function s(c){return Sn(c)?l(c):n(c)}}function j1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ct(e)}function N1(e){return!Cn(e)}function C1(e){return!(e===47||im(e))}function im(e){return e===43||e===45||e===46||e===95||Sn(e)}function qm(e){let n=e.length,l=!1;for(;n--;){const i=e[n][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){l=!0;break}if(i._gfmAutolinkLiteralWalkedInto){l=!1;break}}return e.length>0&&!l&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),l}const X3={tokenize:t4,partial:!0};function P3(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:W3,continuation:{tokenize:J3},exit:e4}},text:{91:{name:"gfmFootnoteCall",tokenize:K3},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Q3,resolveTo:Z3}}}}function Q3(e,n,l){const i=this;let s=i.events.length;const c=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let d;for(;s--;){const p=i.events[s][1];if(p.type==="labelImage"){d=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return f;function f(p){if(!d||!d._balanced)return l(p);const m=gr(i.sliceSerialize({start:d.end,end:i.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?l(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),n(p))}}function Z3(e,n){let l=e.length;for(;l--;)if(e[l][1].type==="labelImage"&&e[l][0]==="enter"){e[l][1];break}e[l+1][1].type="data",e[l+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[l+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[l+3][1].end),end:Object.assign({},e[l+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},f=[e[l+1],e[l+2],["enter",i,n],e[l+3],e[l+4],["enter",s,n],["exit",s,n],["enter",c,n],["enter",d,n],["exit",d,n],["exit",c,n],e[e.length-2],e[e.length-1],["exit",i,n]];return e.splice(l,e.length-l+1,...f),e}function K3(e,n,l){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let c=0,d;return f;function f(b){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),p}function p(b){return b!==94?l(b):(e.enter("gfmFootnoteCallMarker"),e.consume(b),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(b){if(c>999||b===93&&!d||b===null||b===91||Ct(b))return l(b);if(b===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return s.includes(gr(i.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):l(b)}return Ct(b)||(d=!0),c++,e.consume(b),b===92?x:m}function x(b){return b===91||b===92||b===93?(e.consume(b),c++,m):m(b)}}function W3(e,n,l){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let c,d=0,f;return p;function p(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",x):l(w)}function x(w){if(d>999||w===93&&!f||w===null||w===91||Ct(w))return l(w);if(w===93){e.exit("chunkString");const N=e.exit("gfmFootnoteDefinitionLabelString");return c=gr(i.sliceSerialize(N)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Ct(w)||(f=!0),d++,e.consume(w),w===92?b:x}function b(w){return w===91||w===92||w===93?(e.consume(w),d++,x):x(w)}function y(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),s.includes(c)||s.push(c),ut(e,v,"gfmFootnoteDefinitionWhitespace")):l(w)}function v(w){return n(w)}}function J3(e,n,l){return e.check(Us,n,e.attempt(X3,n,l))}function e4(e){e.exit("gfmFootnoteDefinition")}function t4(e,n,l){const i=this;return ut(e,s,"gfmFootnoteDefinitionIndent",5);function s(c){const d=i.events[i.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?n(c):l(c)}}function n4(e){let l=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:c,resolveAll:s};return l==null&&(l=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function s(d,f){let p=-1;for(;++p<d.length;)if(d[p][0]==="enter"&&d[p][1].type==="strikethroughSequenceTemporary"&&d[p][1]._close){let m=p;for(;m--;)if(d[m][0]==="exit"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._open&&d[p][1].end.offset-d[p][1].start.offset===d[m][1].end.offset-d[m][1].start.offset){d[p][1].type="strikethroughSequence",d[m][1].type="strikethroughSequence";const x={type:"strikethrough",start:Object.assign({},d[m][1].start),end:Object.assign({},d[p][1].end)},b={type:"strikethroughText",start:Object.assign({},d[m][1].end),end:Object.assign({},d[p][1].start)},y=[["enter",x,f],["enter",d[m][1],f],["exit",d[m][1],f],["enter",b,f]],v=f.parser.constructs.insideSpan.null;v&&Kn(y,y.length,0,zc(v,d.slice(m+1,p),f)),Kn(y,y.length,0,[["exit",b,f],["enter",d[p][1],f],["exit",d[p][1],f],["exit",x,f]]),Kn(d,m-1,p-m+3,y),p=m+y.length-2;break}}for(p=-1;++p<d.length;)d[p][1].type==="strikethroughSequenceTemporary"&&(d[p][1].type="data");return d}function c(d,f,p){const m=this.previous,x=this.events;let b=0;return y;function y(w){return m===126&&x[x.length-1][1].type!=="characterEscape"?p(w):(d.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const N=oa(m);if(w===126)return b>1?p(w):(d.consume(w),b++,v);if(b<2&&!l)return p(w);const j=d.exit("strikethroughSequenceTemporary"),k=oa(w);return j._open=!k||k===2&&!!N,j._close=!N||N===2&&!!k,f(w)}}}class r4{constructor(){this.map=[]}add(n,l,i){l4(this,n,l,i)}consume(n){if(this.map.sort(function(c,d){return c[0]-d[0]}),this.map.length===0)return;let l=this.map.length;const i=[];for(;l>0;)l-=1,i.push(n.slice(this.map[l][0]+this.map[l][1]),this.map[l][2]),n.length=this.map[l][0];i.push(n.slice()),n.length=0;let s=i.pop();for(;s;){for(const c of s)n.push(c);s=i.pop()}this.map.length=0}}function l4(e,n,l,i){let s=0;if(!(l===0&&i.length===0)){for(;s<e.map.length;){if(e.map[s][0]===n){e.map[s][1]+=l,e.map[s][2].push(...i);return}s+=1}e.map.push([n,l,i])}}function i4(e,n){let l=!1;const i=[];for(;n<e.length;){const s=e[n];if(l){if(s[0]==="enter")s[1].type==="tableContent"&&i.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const c=i.length-1;i[c]=i[c]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(l=!0);n+=1}return i}function a4(){return{flow:{null:{name:"table",tokenize:s4,resolveAll:o4}}}}function s4(e,n,l){const i=this;let s=0,c=0,d;return f;function f(D){let Q=i.events.length-1;for(;Q>-1;){const H=i.events[Q][1].type;if(H==="lineEnding"||H==="linePrefix")Q--;else break}const M=Q>-1?i.events[Q][1].type:null,V=M==="tableHead"||M==="tableRow"?I:p;return V===I&&i.parser.lazy[i.now().line]?l(D):V(D)}function p(D){return e.enter("tableHead"),e.enter("tableRow"),m(D)}function m(D){return D===124||(d=!0,c+=1),x(D)}function x(D){return D===null?l(D):Ie(D)?c>1?(c=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),v):l(D):rt(D)?ut(e,x,"whitespace")(D):(c+=1,d&&(d=!1,s+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),d=!0,x):(e.enter("data"),b(D)))}function b(D){return D===null||D===124||Ct(D)?(e.exit("data"),x(D)):(e.consume(D),D===92?y:b)}function y(D){return D===92||D===124?(e.consume(D),b):b(D)}function v(D){return i.interrupt=!1,i.parser.lazy[i.now().line]?l(D):(e.enter("tableDelimiterRow"),d=!1,rt(D)?ut(e,w,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):w(D))}function w(D){return D===45||D===58?j(D):D===124?(d=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),N):G(D)}function N(D){return rt(D)?ut(e,j,"whitespace")(D):j(D)}function j(D){return D===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),k):D===45?(c+=1,k(D)):D===null||Ie(D)?L(D):G(D)}function k(D){return D===45?(e.enter("tableDelimiterFiller"),T(D)):G(D)}function T(D){return D===45?(e.consume(D),T):D===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(D))}function C(D){return rt(D)?ut(e,L,"whitespace")(D):L(D)}function L(D){return D===124?w(D):D===null||Ie(D)?!d||s!==c?G(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(D)):G(D)}function G(D){return l(D)}function I(D){return e.enter("tableRow"),R(D)}function R(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),R):D===null||Ie(D)?(e.exit("tableRow"),n(D)):rt(D)?ut(e,R,"whitespace")(D):(e.enter("data"),X(D))}function X(D){return D===null||D===124||Ct(D)?(e.exit("data"),R(D)):(e.consume(D),D===92?U:X)}function U(D){return D===92||D===124?(e.consume(D),X):X(D)}}function o4(e,n){let l=-1,i=!0,s=0,c=[0,0,0,0],d=[0,0,0,0],f=!1,p=0,m,x,b;const y=new r4;for(;++l<e.length;){const v=e[l],w=v[1];v[0]==="enter"?w.type==="tableHead"?(f=!1,p!==0&&(t0(y,n,p,m,x),x=void 0,p=0),m={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(l,0,[["enter",m,n]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(i=!0,b=void 0,c=[0,0,0,0],d=[0,l+1,0,0],f&&(f=!1,x={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(l,0,[["enter",x,n]])),s=w.type==="tableDelimiterRow"?2:x?3:1):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(i=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],b=oc(y,n,c,s,void 0,b),c=[0,0,0,0]),d[2]=l)):w.type==="tableCellDivider"&&(i?i=!1:(c[1]!==0&&(d[0]=d[1],b=oc(y,n,c,s,void 0,b)),c=d,d=[c[1],l,0,0])):w.type==="tableHead"?(f=!0,p=l):w.type==="tableRow"||w.type==="tableDelimiterRow"?(p=l,c[1]!==0?(d[0]=d[1],b=oc(y,n,c,s,l,b)):d[1]!==0&&(b=oc(y,n,d,s,l,b)),s=0):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(d[3]=l)}for(p!==0&&t0(y,n,p,m,x),y.consume(n.events),l=-1;++l<n.events.length;){const v=n.events[l];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=i4(n.events,l))}return e}function oc(e,n,l,i,s,c){const d=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",f="tableContent";l[0]!==0&&(c.end=Object.assign({},na(n.events,l[0])),e.add(l[0],0,[["exit",c,n]]));const p=na(n.events,l[1]);if(c={type:d,start:Object.assign({},p),end:Object.assign({},p)},e.add(l[1],0,[["enter",c,n]]),l[2]!==0){const m=na(n.events,l[2]),x=na(n.events,l[3]),b={type:f,start:Object.assign({},m),end:Object.assign({},x)};if(e.add(l[2],0,[["enter",b,n]]),i!==2){const y=n.events[l[2]],v=n.events[l[3]];if(y[1].end=Object.assign({},v[1].end),y[1].type="chunkText",y[1].contentType="text",l[3]>l[2]+1){const w=l[2]+1,N=l[3]-l[2]-1;e.add(w,N,[])}}e.add(l[3]+1,0,[["exit",b,n]])}return s!==void 0&&(c.end=Object.assign({},na(n.events,s)),e.add(s,0,[["exit",c,n]]),c=void 0),c}function t0(e,n,l,i,s){const c=[],d=na(n.events,l);s&&(s.end=Object.assign({},d),c.push(["exit",s,n])),i.end=Object.assign({},d),c.push(["exit",i,n]),e.add(l+1,0,c)}function na(e,n){const l=e[n],i=l[0]==="enter"?"start":"end";return l[1][i]}const c4={name:"tasklistCheck",tokenize:d4};function u4(){return{text:{91:c4}}}function d4(e,n,l){const i=this;return s;function s(p){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?l(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),c)}function c(p){return Ct(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),d):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),d):l(p)}function d(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):l(p)}function f(p){return Ie(p)?n(p):rt(p)?e.check({tokenize:f4},n,l)(p):l(p)}}function f4(e,n,l){return ut(e,i,"whitespace");function i(s){return s===null?l(s):n(s)}}function m4(e){return Iv([B3(),P3(),n4(e),a4(),u4()])}const p4={};function h4(e){const n=this,l=e||p4,i=n.data(),s=i.micromarkExtensions||(i.micromarkExtensions=[]),c=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),d=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);s.push(m4(l)),c.push(z3()),d.push(D3(l))}function g4(e,n){if(e==null)return{};var l={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;l[i]=e[i]}return l}function x4(e,n){if(e==null)return{};var l,i,s=g4(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(i=0;i<c.length;i++)l=c[i],n.indexOf(l)===-1&&{}.propertyIsEnumerable.call(e,l)&&(s[l]=e[l])}return s}function am(e,n){(n==null||n>e.length)&&(n=e.length);for(var l=0,i=Array(n);l<n;l++)i[l]=e[l];return i}function b4(e){if(Array.isArray(e))return am(e)}function y4(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function v4(e,n){if(e){if(typeof e=="string")return am(e,n);var l={}.toString.call(e).slice(8,-1);return l==="Object"&&e.constructor&&(l=e.constructor.name),l==="Map"||l==="Set"?Array.from(e):l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?am(e,n):void 0}}function S4(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
99
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sm(e){return b4(e)||y4(e)||v4(e)||S4()}function Rs(e){"@babel/helpers - typeof";return Rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Rs(e)}function w4(e,n){if(Rs(e)!="object"||!e)return e;var l=e[Symbol.toPrimitive];if(l!==void 0){var i=l.call(e,n);if(Rs(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function k4(e){var n=w4(e,"string");return Rs(n)=="symbol"?n:n+""}function E1(e,n,l){return(n=k4(n))in e?Object.defineProperty(e,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[n]=l,e}function om(){return om=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var l=arguments[n];for(var i in l)({}).hasOwnProperty.call(l,i)&&(e[i]=l[i])}return e},om.apply(null,arguments)}function n0(e,n){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),l.push.apply(l,i)}return l}function ra(e){for(var n=1;n<arguments.length;n++){var l=arguments[n]!=null?arguments[n]:{};n%2?n0(Object(l),!0).forEach(function(i){E1(e,i,l[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):n0(Object(l)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(l,i))})}return e}function j4(e){var n=e.length;if(n===0||n===1)return e;if(n===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(n===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(n>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var Bf={};function N4(e){if(e.length===0||e.length===1)return e;var n=e.join(".");return Bf[n]||(Bf[n]=j4(e)),Bf[n]}function C4(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=arguments.length>2?arguments[2]:void 0,i=e.filter(function(c){return c!=="token"}),s=N4(i);return s.reduce(function(c,d){return ra(ra({},c),l[d])},n)}function r0(e){return e.join(" ")}function E4(e,n){var l=0;return function(i){return l+=1,i.map(function(s,c){return T1({node:s,stylesheet:e,useInlineStyles:n,key:"code-segment-".concat(l,"-").concat(c)})})}}function T1(e){var n=e.node,l=e.stylesheet,i=e.style,s=i===void 0?{}:i,c=e.useInlineStyles,d=e.key,f=n.properties,p=n.type,m=n.tagName,x=n.value;if(p==="text")return x;if(m){var b=E4(l,c),y;if(!c)y=ra(ra({},f),{},{className:r0(f.className)});else{var v=Object.keys(l).reduce(function(k,T){return T.split(".").forEach(function(C){k.includes(C)||k.push(C)}),k},[]),w=f.className&&f.className.includes("token")?["token"]:[],N=f.className&&w.concat(f.className.filter(function(k){return!v.includes(k)}));y=ra(ra({},f),{},{className:r0(N)||void 0,style:C4(f.className,Object.assign({},f.style,s),l)})}var j=b(n.children);return ke.createElement(m,om({key:d},y),j)}}const T4=(function(e,n){var l=e.listLanguages();return l.indexOf(n)!==-1});var A4=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function l0(e,n){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),l.push.apply(l,i)}return l}function El(e){for(var n=1;n<arguments.length;n++){var l=arguments[n]!=null?arguments[n]:{};n%2?l0(Object(l),!0).forEach(function(i){E1(e,i,l[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):l0(Object(l)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(l,i))})}return e}var O4=/\n/g;function _4(e){return e.match(O4)}function R4(e){var n=e.lines,l=e.startingLineNumber,i=e.style;return n.map(function(s,c){var d=c+l;return ke.createElement("span",{key:"line-".concat(c),className:"react-syntax-highlighter-line-number",style:typeof i=="function"?i(d):i},"".concat(d,`
100
- `))})}function M4(e){var n=e.codeString,l=e.codeStyle,i=e.containerStyle,s=i===void 0?{float:"left",paddingRight:"10px"}:i,c=e.numberStyle,d=c===void 0?{}:c,f=e.startingLineNumber;return ke.createElement("code",{style:Object.assign({},l,s)},R4({lines:n.replace(/\n$/,"").split(`
101
- `),style:d,startingLineNumber:f}))}function z4(e){return"".concat(e.toString().length,".25em")}function A1(e,n){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:n},children:[{type:"text",value:e}]}}function O1(e,n,l){var i={display:"inline-block",minWidth:z4(l),paddingRight:"1em",textAlign:"right",userSelect:"none"},s=typeof e=="function"?e(n):e,c=El(El({},i),s);return c}function pc(e){var n=e.children,l=e.lineNumber,i=e.lineNumberStyle,s=e.largestLineNumber,c=e.showInlineLineNumbers,d=e.lineProps,f=d===void 0?{}:d,p=e.className,m=p===void 0?[]:p,x=e.showLineNumbers,b=e.wrapLongLines,y=e.wrapLines,v=y===void 0?!1:y,w=v?El({},typeof f=="function"?f(l):f):{};if(w.className=w.className?[].concat(sm(w.className.trim().split(/\s+/)),sm(m)):m,l&&c){var N=O1(i,l,s);n.unshift(A1(l,N))}return b&x&&(w.style=El({display:"flex"},w.style)),{type:"element",tagName:"span",properties:w,children:n}}function _1(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];e.length===void 0&&(e=[e]);for(var i=0;i<e.length;i++){var s=e[i];if(s.type==="text")l.push(pc({children:[s],className:sm(new Set(n))}));else if(s.children){var c,d=n.concat(((c=s.properties)===null||c===void 0?void 0:c.className)||[]);_1(s.children,d).forEach(function(f){return l.push(f)})}}return l}function D4(e,n,l,i,s,c,d,f,p){var m,x=_1(e.value),b=[],y=-1,v=0;function w(G,I){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return pc({children:G,lineNumber:I,lineNumberStyle:f,largestLineNumber:d,showInlineLineNumbers:s,lineProps:l,className:R,showLineNumbers:i,wrapLongLines:p,wrapLines:n})}function N(G,I){if(i&&I&&s){var R=O1(f,I,d);G.unshift(A1(I,R))}return G}function j(G,I){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return n||R.length>0?w(G,I,R):N(G,I)}for(var k=function(){var I=x[v],R=I.children[0].value,X=_4(R);if(X){var U=R.split(`
102
- `);U.forEach(function(D,Q){var M=i&&b.length+c,V={type:"text",value:"".concat(D,`
103
- `)};if(Q===0){var H=x.slice(y+1,v).concat(pc({children:[V],className:I.properties.className})),q=j(H,M);b.push(q)}else if(Q===U.length-1){var B=x[v+1]&&x[v+1].children&&x[v+1].children[0],P={type:"text",value:"".concat(D)};if(B){var oe=pc({children:[P],className:I.properties.className});x.splice(v+1,0,oe)}else{var ae=[P],A=j(ae,M,I.properties.className);b.push(A)}}else{var z=[V],W=j(z,M,I.properties.className);b.push(W)}}),y=v}v++};v<x.length;)k();if(y!==x.length-1){var T=x.slice(y+1,x.length);if(T&&T.length){var C=i&&b.length+c,L=j(T,C);b.push(L)}}return n?b:(m=[]).concat.apply(m,b)}function L4(e){var n=e.rows,l=e.stylesheet,i=e.useInlineStyles;return n.map(function(s,c){return T1({node:s,stylesheet:l,useInlineStyles:i,key:"code-segment-".concat(c)})})}function R1(e){return e&&typeof e.highlightAuto<"u"}function I4(e){var n=e.astGenerator,l=e.language,i=e.code,s=e.defaultCodeValue;if(R1(n)){var c=T4(n,l);return l==="text"?{value:s,language:"text"}:c?n.highlight(l,i):n.highlightAuto(i)}try{return l&&l!=="text"?{value:n.highlight(i,l)}:{value:s}}catch{return{value:s}}}function B4(e,n){return function(i){var s,c,d=i.language,f=i.children,p=i.style,m=p===void 0?n:p,x=i.customStyle,b=x===void 0?{}:x,y=i.codeTagProps,v=y===void 0?{className:d?"language-".concat(d):void 0,style:El(El({},m['code[class*="language-"]']),m['code[class*="language-'.concat(d,'"]')])}:y,w=i.useInlineStyles,N=w===void 0?!0:w,j=i.showLineNumbers,k=j===void 0?!1:j,T=i.showInlineLineNumbers,C=T===void 0?!0:T,L=i.startingLineNumber,G=L===void 0?1:L,I=i.lineNumberContainerStyle,R=i.lineNumberStyle,X=R===void 0?{}:R,U=i.wrapLines,D=i.wrapLongLines,Q=D===void 0?!1:D,M=i.lineProps,V=M===void 0?{}:M,H=i.renderer,q=i.PreTag,B=q===void 0?"pre":q,P=i.CodeTag,oe=P===void 0?"code":P,ae=i.code,A=ae===void 0?(Array.isArray(f)?f[0]:f)||"":ae,z=i.astGenerator,W=x4(i,A4);z=z||e;var O=k?ke.createElement(M4,{containerStyle:I,codeStyle:v.style||{},numberStyle:X,startingLineNumber:G,codeString:A}):null,$=m.hljs||m['pre[class*="language-"]']||{backgroundColor:"#fff"},ee=R1(z)?"hljs":"prismjs",re=N?Object.assign({},W,{style:Object.assign({},$,b)}):Object.assign({},W,{className:W.className?"".concat(ee," ").concat(W.className):ee,style:Object.assign({},b)});if(Q?v.style=El({whiteSpace:"pre-wrap"},v.style):v.style=El({whiteSpace:"pre"},v.style),!z)return ke.createElement(B,re,O,ke.createElement(oe,v,A));(U===void 0&&H||Q)&&(U=!0),H=H||L4;var Y=[{type:"text",value:A}],le=I4({astGenerator:z,language:d,code:A,defaultCodeValue:Y});le.language===null&&(le.value=Y);var xe=(s=(c=A.match(/\n/g))===null||c===void 0?void 0:c.length)!==null&&s!==void 0?s:0,Te=G+xe,je=D4(le,U,V,k,C,G,Te,X,Q);return ke.createElement(B,re,ke.createElement(oe,v,!C&&O,H({rows:je,stylesheet:m,useInlineStyles:N})))}}const i0=/[#.]/g;function H4(e,n){const l=e||"",i={};let s=0,c,d;for(;s<l.length;){i0.lastIndex=s;const f=i0.exec(l),p=l.slice(s,f?f.index:l.length);p&&(c?c==="#"?i.id=p:Array.isArray(i.className)?i.className.push(p):i.className=[p]:d=p,s+=p.length),f&&(c=f[0],s++)}return{type:"element",tagName:d||n||"div",properties:i,children:[]}}function M1(e,n,l){const i=l?G4(l):void 0;function s(c,d,...f){let p;if(c==null){p={type:"root",children:[]};const m=d;f.unshift(m)}else{p=H4(c,n);const m=p.tagName.toLowerCase(),x=i?i.get(m):void 0;if(p.tagName=x||m,U4(d))f.unshift(d);else for(const[b,y]of Object.entries(d))F4(e,p.properties,b,y)}for(const m of f)cm(p.children,m);return p.type==="element"&&p.tagName==="template"&&(p.content={type:"root",children:p.children},p.children=[]),p}return s}function U4(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const n=e,l=Object.keys(e);for(const i of l){const s=n[i];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const c=s;for(const d of c)if(typeof d!="number"&&typeof d!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function F4(e,n,l,i){const s=Tv(e,l);let c;if(i!=null){if(typeof i=="number"){if(Number.isNaN(i))return;c=i}else typeof i=="boolean"?c=i:typeof i=="string"?s.spaceSeparated?c=gy(i):s.commaSeparated?c=dy(i):s.commaOrSpaceSeparated?c=gy(dy(i).join(" ")):c=a0(s,s.property,i):Array.isArray(i)?c=[...i]:c=s.property==="style"?$4(i):String(i);if(Array.isArray(c)){const d=[];for(const f of c)d.push(a0(s,s.property,f));c=d}s.property==="className"&&Array.isArray(n.className)&&(c=n.className.concat(c)),n[s.property]=c}}function cm(e,n){if(n!=null)if(typeof n=="number"||typeof n=="string")e.push({type:"text",value:String(n)});else if(Array.isArray(n))for(const l of n)cm(e,l);else if(typeof n=="object"&&"type"in n)n.type==="root"?cm(e,n.children):e.push(n);else throw new Error("Expected node, nodes, or string, got `"+n+"`")}function a0(e,n,l){if(typeof l=="string"){if(e.number&&l&&!Number.isNaN(Number(l)))return Number(l);if((e.boolean||e.overloadedBoolean)&&(l===""||Ts(l)===Ts(n)))return!0}return l}function $4(e){const n=[];for(const[l,i]of Object.entries(e))n.push([l,i].join(": "));return n.join("; ")}function G4(e){const n=new Map;for(const l of e)n.set(l.toLowerCase(),l);return n}const q4=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],V4=M1(Av,"div");M1(Rc,"g",q4);const Y4=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],s0={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function z1(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=48&&n<=57}function X4(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function P4(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function o0(e){return P4(e)||z1(e)}const Q4=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Z4(e,n){const l={},i=typeof l.additional=="string"?l.additional.charCodeAt(0):l.additional,s=[];let c=0,d=-1,f="",p,m;l.position&&("start"in l.position||"indent"in l.position?(m=l.position.indent,p=l.position.start):p=l.position);let x=(p?p.line:0)||1,b=(p?p.column:0)||1,y=w(),v;for(c--;++c<=e.length;)if(v===10&&(b=(m?m[d]:0)||1),v=e.charCodeAt(c),v===38){const k=e.charCodeAt(c+1);if(k===9||k===10||k===12||k===32||k===38||k===60||Number.isNaN(k)||i&&k===i){f+=String.fromCharCode(v),b++;continue}const T=c+1;let C=T,L=T,G;if(k===35){L=++C;const V=e.charCodeAt(L);V===88||V===120?(G="hexadecimal",L=++C):G="decimal"}else G="named";let I="",R="",X="";const U=G==="named"?o0:G==="decimal"?z1:X4;for(L--;++L<=e.length;){const V=e.charCodeAt(L);if(!U(V))break;X+=String.fromCharCode(V),G==="named"&&Y4.includes(X)&&(I=X,R=Os(X))}let D=e.charCodeAt(L)===59;if(D){L++;const V=G==="named"?Os(X):!1;V&&(I=X,R=V)}let Q=1+L-T,M="";if(!(!D&&l.nonTerminated===!1))if(!X)G!=="named"&&N(4,Q);else if(G==="named"){if(D&&!R)N(5,1);else if(I!==X&&(L=C+I.length,Q=1+L-C,D=!1),!D){const V=I?1:3;if(l.attribute){const H=e.charCodeAt(L);H===61?(N(V,Q),R=""):o0(H)?R="":N(V,Q)}else N(V,Q)}M=R}else{D||N(2,Q);let V=Number.parseInt(X,G==="hexadecimal"?16:10);if(K4(V))N(7,Q),M="�";else if(V in s0)N(6,Q),M=s0[V];else{let H="";W4(V)&&N(6,Q),V>65535&&(V-=65536,H+=String.fromCharCode(V>>>10|55296),V=56320|V&1023),M=H+String.fromCharCode(V)}}if(M){j(),y=w(),c=L-1,b+=L-T+1,s.push(M);const V=w();V.offset++,l.reference&&l.reference.call(l.referenceContext||void 0,M,{start:y,end:V},e.slice(T-1,L)),y=V}else X=e.slice(T-1,L),f+=X,b+=X.length,c=L-1}else v===10&&(x++,d++,b=0),Number.isNaN(v)?j():(f+=String.fromCharCode(v),b++);return s.join("");function w(){return{line:x,column:b,offset:c+((p?p.offset:0)||0)}}function N(k,T){let C;l.warning&&(C=w(),C.column+=T,C.offset+=T,l.warning.call(l.warningContext||void 0,Q4[k],C,k))}function j(){f&&(s.push(f),l.text&&l.text.call(l.textContext||void 0,f,{start:y,end:w()}),f="")}}function K4(e){return e>=55296&&e<=57343||e>1114111}function W4(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var J4=0,cc={},cn={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++J4}),e.__id},clone:function e(n,l){l=l||{};var i,s;switch(cn.util.type(n)){case"Object":if(s=cn.util.objId(n),l[s])return l[s];i={},l[s]=i;for(var c in n)n.hasOwnProperty(c)&&(i[c]=e(n[c],l));return i;case"Array":return s=cn.util.objId(n),l[s]?l[s]:(i=[],l[s]=i,n.forEach(function(d,f){i[f]=e(d,l)}),i);default:return n}}},languages:{plain:cc,plaintext:cc,text:cc,txt:cc,extend:function(e,n){var l=cn.util.clone(cn.languages[e]);for(var i in n)l[i]=n[i];return l},insertBefore:function(e,n,l,i){i=i||cn.languages;var s=i[e],c={};for(var d in s)if(s.hasOwnProperty(d)){if(d==n)for(var f in l)l.hasOwnProperty(f)&&(c[f]=l[f]);l.hasOwnProperty(d)||(c[d]=s[d])}var p=i[e];return i[e]=c,cn.languages.DFS(cn.languages,function(m,x){x===p&&m!=e&&(this[m]=c)}),c},DFS:function e(n,l,i,s){s=s||{};var c=cn.util.objId;for(var d in n)if(n.hasOwnProperty(d)){l.call(n,d,n[d],i||d);var f=n[d],p=cn.util.type(f);p==="Object"&&!s[c(f)]?(s[c(f)]=!0,e(f,l,null,s)):p==="Array"&&!s[c(f)]&&(s[c(f)]=!0,e(f,l,d,s))}}},plugins:{},highlight:function(e,n,l){var i={code:e,grammar:n,language:l};if(cn.hooks.run("before-tokenize",i),!i.grammar)throw new Error('The language "'+i.language+'" has no grammar.');return i.tokens=cn.tokenize(i.code,i.grammar),cn.hooks.run("after-tokenize",i),vs.stringify(cn.util.encode(i.tokens),i.language)},tokenize:function(e,n){var l=n.rest;if(l){for(var i in l)n[i]=l[i];delete n.rest}var s=new eO;return hc(s,s.head,e),D1(e,s,n,s.head,0),nO(s)},hooks:{all:{},add:function(e,n){var l=cn.hooks.all;l[e]=l[e]||[],l[e].push(n)},run:function(e,n){var l=cn.hooks.all[e];if(!(!l||!l.length))for(var i=0,s;s=l[i++];)s(n)}},Token:vs};function vs(e,n,l,i){this.type=e,this.content=n,this.alias=l,this.length=(i||"").length|0}function c0(e,n,l,i){e.lastIndex=n;var s=e.exec(l);if(s&&i&&s[1]){var c=s[1].length;s.index+=c,s[0]=s[0].slice(c)}return s}function D1(e,n,l,i,s,c){for(var d in l)if(!(!l.hasOwnProperty(d)||!l[d])){var f=l[d];f=Array.isArray(f)?f:[f];for(var p=0;p<f.length;++p){if(c&&c.cause==d+","+p)return;var m=f[p],x=m.inside,b=!!m.lookbehind,y=!!m.greedy,v=m.alias;if(y&&!m.pattern.global){var w=m.pattern.toString().match(/[imsuy]*$/)[0];m.pattern=RegExp(m.pattern.source,w+"g")}for(var N=m.pattern||m,j=i.next,k=s;j!==n.tail&&!(c&&k>=c.reach);k+=j.value.length,j=j.next){var T=j.value;if(n.length>e.length)return;if(!(T instanceof vs)){var C=1,L;if(y){if(L=c0(N,k,e,b),!L||L.index>=e.length)break;var X=L.index,G=L.index+L[0].length,I=k;for(I+=j.value.length;X>=I;)j=j.next,I+=j.value.length;if(I-=j.value.length,k=I,j.value instanceof vs)continue;for(var R=j;R!==n.tail&&(I<G||typeof R.value=="string");R=R.next)C++,I+=R.value.length;C--,T=e.slice(k,I),L.index-=k}else if(L=c0(N,0,T,b),!L)continue;var X=L.index,U=L[0],D=T.slice(0,X),Q=T.slice(X+U.length),M=k+T.length;c&&M>c.reach&&(c.reach=M);var V=j.prev;D&&(V=hc(n,V,D),k+=D.length),tO(n,V,C);var H=new vs(d,x?cn.tokenize(U,x):U,v,U);if(j=hc(n,V,H),Q&&hc(n,j,Q),C>1){var q={cause:d+","+p,reach:M};D1(e,n,l,j.prev,k,q),c&&q.reach>c.reach&&(c.reach=q.reach)}}}}}}function eO(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function hc(e,n,l){var i=n.next,s={value:l,prev:n,next:i};return n.next=s,i.prev=s,e.length++,s}function tO(e,n,l){for(var i=n.next,s=0;s<l&&i!==e.tail;s++)i=i.next;n.next=i,i.prev=n,e.length-=s}function nO(e){for(var n=[],l=e.head.next;l!==e.tail;)n.push(l.value),l=l.next;return n}const L1=cn;function I1(){}I1.prototype=L1;const an=new I1;an.highlight=rO;an.register=lO;an.alias=iO;an.registered=aO;an.listLanguages=sO;an.util.encode=oO;an.Token.stringify=um;function rO(e,n){if(typeof e!="string")throw new TypeError("Expected `string` for `value`, got `"+e+"`");let l,i;if(n&&typeof n=="object")l=n;else{if(i=n,typeof i!="string")throw new TypeError("Expected `string` for `name`, got `"+i+"`");if(Object.hasOwn(an.languages,i))l=an.languages[i];else throw new Error("Unknown language: `"+i+"` is not registered")}return{type:"root",children:L1.highlight.call(an,e,l,i)}}function lO(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn(an.languages,e.displayName)||e(an)}function iO(e,n){const l=an.languages;let i={};typeof e=="string"?n&&(i[e]=n):i=e;let s;for(s in i)if(Object.hasOwn(i,s)){const c=i[s],d=typeof c=="string"?[c]:c;let f=-1;for(;++f<d.length;)l[d[f]]=l[s]}}function aO(e){if(typeof e!="string")throw new TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn(an.languages,e)}function sO(){const e=an.languages,n=[];let l;for(l in e)Object.hasOwn(e,l)&&typeof e[l]=="object"&&n.push(l);return n}function um(e,n){if(typeof e=="string")return{type:"text",value:e};if(Array.isArray(e)){const i=[];let s=-1;for(;++s<e.length;)e[s]!==null&&e[s]!==void 0&&e[s]!==""&&i.push(um(e[s],n));return i}const l={attributes:{},classes:["token",e.type],content:um(e.content,n),language:n,tag:"span",type:e.type};return e.alias&&l.classes.push(...typeof e.alias=="string"?[e.alias]:e.alias),an.hooks.run("wrap",l),V4(l.tag+"."+l.classes.join("."),cO(l.attributes),l.content)}function oO(e){return e}function cO(e){let n;for(n in e)Object.hasOwn(e,n)&&(e[n]=Z4(e[n]));return e}var yt=B4(an,{});yt.registerLanguage=function(e,n){return an.register(n)};yt.alias=function(e,n){return an.alias(e,n)};ui.displayName="markup";ui.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function ui(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&amp;/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(l,i){var s={};s["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[i]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var c={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};c["language-"+i]={pattern:/[\s\S]+/,inside:e.languages[i]};var d={};d[l]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return l}),"i"),lookbehind:!0,greedy:!0,inside:c},e.languages.insertBefore("markup","cdata",d)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,l){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[l,"language-"+l],inside:e.languages[l]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}Bc.displayName="css";Bc.aliases=[];function Bc(e){(function(n){var l=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+l.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+l.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+l.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+l.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:l,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var i=n.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))})(e)}di.displayName="clike";di.aliases=[];function di(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}$s.displayName="javascript";$s.aliases=["js"];function $s(e){e.register(di),e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}Vm.displayName="sql";Vm.aliases=[];function Vm(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}Hc.displayName="c";Hc.aliases=[];function Hc(e){e.register(di),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}Ym.displayName="cpp";Ym.aliases=[];function Ym(e){e.register(Hc),(function(n){var l=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,i=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return l.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return l.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:l,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return i})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}Xm.displayName="bash";Xm.aliases=["sh","shell"];function Xm(e){(function(n){var l="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",i={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:i,environment:{pattern:RegExp("\\$"+l),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+l),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};n.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+l),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:i}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+l),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},i.inside=n.languages.bash;for(var c=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],d=s.variable[1].inside,f=0;f<c.length;f++)d[c[f]]=n.languages.bash[c[f]];n.languages.sh=n.languages.bash,n.languages.shell=n.languages.bash})(e)}Pm.displayName="yaml";Pm.aliases=["yml"];function Pm(e){(function(n){var l=/[*&][^\s[\]{},]+/,i=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+i.source+"(?:[ ]+"+l.source+")?|"+l.source+"(?:[ ]+"+i.source+")?)",c=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),d=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function f(p,m){m=(m||"").replace(/m/g,"")+"m";var x=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<value>>/g,function(){return p});return RegExp(x,m)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<key>>/g,function(){return"(?:"+c+"|"+d+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:f(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:f(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:f(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:f(d),lookbehind:!0,greedy:!0},number:{pattern:f(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:i,important:l,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}Qm.displayName="markdown";Qm.aliases=["md"];function Qm(e){e.register(ui),(function(n){var l=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function i(f){return f=f.replace(/<inner>/g,function(){return l}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+f+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,c=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),d=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+c+d+"(?:"+c+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+c+d+")(?:"+c+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+c+")"+d+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+c+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:i(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:i(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:i(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:i(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(f){["url","bold","italic","strike","code-snippet"].forEach(function(p){f!==p&&(n.languages.markdown[f].inside.content.inside[p]=n.languages.markdown[p])})}),n.hooks.add("after-tokenize",function(f){if(f.language!=="markdown"&&f.language!=="md")return;function p(m){if(!(!m||typeof m=="string"))for(var x=0,b=m.length;x<b;x++){var y=m[x];if(y.type!=="code"){p(y.content);continue}var v=y.content[1],w=y.content[3];if(v&&w&&v.type==="code-language"&&w.type==="code-block"&&typeof v.content=="string"){var N=v.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");N=(/[a-z][\w-]*/i.exec(N)||[""])[0].toLowerCase();var j="language-"+N;w.alias?typeof w.alias=="string"?w.alias=[w.alias,j]:w.alias.push(j):w.alias=[j]}}}p(f.tokens)}),n.hooks.add("wrap",function(f){if(f.type==="code-block"){for(var p="",m=0,x=f.classes.length;m<x;m++){var b=f.classes[m],y=/language-(.+)/.exec(b);if(y){p=y[1];break}}var v=n.languages[p];if(v)f.content=n.highlight(f.content.value,v,p);else if(p&&p!=="none"&&n.plugins.autoloader){var w="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);f.attributes.id=w,n.plugins.autoloader.loadLanguages(p,function(){var N=document.getElementById(w);N&&(N.innerHTML=n.highlight(N.textContent,n.languages[p],p))})}}}),RegExp(n.languages.markup.tag.pattern.source,"gi"),n.languages.md=n.languages.markdown})(e)}Zm.displayName="ruby";Zm.aliases=["rb"];function Zm(e){e.register(di),(function(n){n.languages.ruby=n.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var l={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.languages.ruby.function;var i="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+i+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:l,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:l,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+i),greedy:!0,inside:{interpolation:l,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:l,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:l,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+i),greedy:!0,inside:{interpolation:l,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:l,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),n.languages.rb=n.languages.ruby})(e)}Km.displayName="diff";Km.aliases=[];function Km(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var l={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(l).forEach(function(i){var s=l[i],c=[];/^\w+$/.test(i)||c.push(/\w+/.exec(i)[0]),i==="diff"&&c.push("bold"),n.languages.diff[i]={pattern:RegExp("^(?:["+s+`].*(?:\r
104
- ?|
105
- |(?![\\s\\S])))+`,"m"),alias:c,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(i)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:l})})(e)}Wm.displayName="docker";Wm.aliases=["dockerfile"];function Wm(e){(function(n){var l=/\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source,i=/(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)/.source.replace(/<SP_BS>/g,function(){return l}),s=/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/.source,c=/--[\w-]+=(?:<STR>|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(/<STR>/g,function(){return s}),d={pattern:RegExp(s),greedy:!0},f={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function p(m,x){return m=m.replace(/<OPT>/g,function(){return c}).replace(/<SP>/g,function(){return i}),RegExp(m,x)}n.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:p(/(^(?:ONBUILD<SP>)?\w+<SP>)<OPT>(?:<SP><OPT>)*/.source,"i"),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[d,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:p(/(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\b/.source,"i"),lookbehind:!0,greedy:!0},{pattern:p(/(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\]+<SP>)AS/.source,"i"),lookbehind:!0,greedy:!0},{pattern:p(/(^ONBUILD<SP>)\w+/.source,"i"),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:f,string:d,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,operator:/\\$/m}},comment:f},n.languages.dockerfile=n.languages.docker})(e)}Jm.displayName="go";Jm.aliases=[];function Jm(e){e.register(di),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}ep.displayName="graphql";ep.aliases=[];function ep(e){e.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:e.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},e.hooks.add("after-tokenize",function(l){if(l.language!=="graphql")return;var i=l.tokens.filter(function(j){return typeof j!="string"&&j.type!=="comment"&&j.type!=="scalar"}),s=0;function c(j){return i[s+j]}function d(j,k){k=k||0;for(var T=0;T<j.length;T++){var C=c(T+k);if(!C||C.type!==j[T])return!1}return!0}function f(j,k){for(var T=1,C=s;C<i.length;C++){var L=i[C],G=L.content;if(L.type==="punctuation"&&typeof G=="string"){if(j.test(G))T++;else if(k.test(G)&&(T--,T===0))return C}}return-1}function p(j,k){var T=j.alias;T?Array.isArray(T)||(j.alias=T=[T]):j.alias=T=[],T.push(k)}for(;s<i.length;){var m=i[s++];if(m.type==="keyword"&&m.content==="mutation"){var x=[];if(d(["definition-mutation","punctuation"])&&c(1).content==="("){s+=2;var b=f(/^\($/,/^\)$/);if(b===-1)continue;for(;s<b;s++){var y=c(0);y.type==="variable"&&(p(y,"variable-input"),x.push(y.content))}s=b+1}if(d(["punctuation","property-query"])&&c(0).content==="{"&&(s++,p(c(0),"property-mutation"),x.length>0)){var v=f(/^\{$/,/^\}$/);if(v===-1)continue;for(var w=s;w<v;w++){var N=i[w];N.type==="variable"&&x.indexOf(N.content)>=0&&p(N,"variable-input")}}}}})}tp.displayName="scss";tp.aliases=[];function tp(e){e.register(Bc),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}np.displayName="json";np.aliases=["webmanifest"];function np(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}rp.displayName="java";rp.aliases=[];function rp(e){e.register(di),(function(n){var l=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,i=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+i+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+i+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+i+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:l,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:l,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+i+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+i+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return l.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}Uc.displayName="typescript";Uc.aliases=["ts"];function Uc(e){e.register($s),(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var l=n.languages.extend("typescript",{});delete l["class-name"],n.languages.typescript["class-name"].inside=l,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:l}}}}),n.languages.ts=n.languages.typescript})(e)}lp.displayName="python";lp.aliases=["py"];function lp(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}Fc.displayName="jsx";Fc.aliases=[];function Fc(e){e.register($s),e.register(ui),(function(n){var l=n.util.clone(n.languages.javascript),i=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,s=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,c=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function d(m,x){return m=m.replace(/<S>/g,function(){return i}).replace(/<BRACES>/g,function(){return s}).replace(/<SPREAD>/g,function(){return c}),RegExp(m,x)}c=d(c).source,n.languages.jsx=n.languages.extend("markup",l),n.languages.jsx.tag.pattern=d(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),n.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,n.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,n.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,n.languages.jsx.tag.inside.comment=l.comment,n.languages.insertBefore("inside","attr-name",{spread:{pattern:d(/<SPREAD>/.source),inside:n.languages.jsx}},n.languages.jsx.tag),n.languages.insertBefore("inside","special-attr",{script:{pattern:d(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:n.languages.jsx}}},n.languages.jsx.tag);var f=function(m){return m?typeof m=="string"?m:typeof m.content=="string"?m.content:m.content.map(f).join(""):""},p=function(m){for(var x=[],b=0;b<m.length;b++){var y=m[b],v=!1;if(typeof y!="string"&&(y.type==="tag"&&y.content[0]&&y.content[0].type==="tag"?y.content[0].content[0].content==="</"?x.length>0&&x[x.length-1].tagName===f(y.content[0].content[1])&&x.pop():y.content[y.content.length-1].content==="/>"||x.push({tagName:f(y.content[0].content[1]),openedBraces:0}):x.length>0&&y.type==="punctuation"&&y.content==="{"?x[x.length-1].openedBraces++:x.length>0&&x[x.length-1].openedBraces>0&&y.type==="punctuation"&&y.content==="}"?x[x.length-1].openedBraces--:v=!0),(v||typeof y=="string")&&x.length>0&&x[x.length-1].openedBraces===0){var w=f(y);b<m.length-1&&(typeof m[b+1]=="string"||m[b+1].type==="plain-text")&&(w+=f(m[b+1]),m.splice(b+1,1)),b>0&&(typeof m[b-1]=="string"||m[b-1].type==="plain-text")&&(w=f(m[b-1])+w,m.splice(b-1,1),b--),m[b]=new n.Token("plain-text",w,null,w)}y.content&&typeof y.content!="string"&&p(y.content)}};n.hooks.add("after-tokenize",function(m){m.language!=="jsx"&&m.language!=="tsx"||p(m.tokens)})})(e)}ip.displayName="tsx";ip.aliases=[];function ip(e){e.register(Fc),e.register(Uc),(function(n){var l=n.util.clone(n.languages.typescript);n.languages.tsx=n.languages.extend("jsx",l),delete n.languages.tsx.parameter,delete n.languages.tsx["literal-property"];var i=n.languages.tsx.tag;i.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+i.pattern.source+")",i.pattern.flags),i.lookbehind=!0})(e)}ap.displayName="rust";ap.aliases=[];function ap(e){(function(n){for(var l=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,i=0;i<2;i++)l=l.replace(/<self>/g,function(){return l});l=l.replace(/<self>/g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+l),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}sp.displayName="toml";sp.aliases=[];function sp(e){(function(n){var l=/(?:[\w-]+|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*")/.source;function i(s){return s.replace(/__/g,function(){return l})}n.languages.toml={comment:{pattern:/#.*/,greedy:!0},table:{pattern:RegExp(i(/(^[\t ]*\[\s*(?:\[\s*)?)__(?:\s*\.\s*__)*(?=\s*\])/.source),"m"),lookbehind:!0,greedy:!0,alias:"class-name"},key:{pattern:RegExp(i(/(^[\t ]*|[{,]\s*)__(?:\s*\.\s*__)*(?=\s*=)/.source),"m"),lookbehind:!0,greedy:!0,alias:"property"},string:{pattern:/"""(?:\\[\s\S]|[^\\])*?"""|'''[\s\S]*?'''|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},date:[{pattern:/\b\d{4}-\d{2}-\d{2}(?:[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b/i,alias:"number"},{pattern:/\b\d{2}:\d{2}:\d{2}(?:\.\d+)?\b/,alias:"number"}],number:/(?:\b0(?:x[\da-zA-Z]+(?:_[\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\b|[-+]?\b\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?\b|[-+]?\b(?:inf|nan)\b/,boolean:/\b(?:false|true)\b/,punctuation:/[.,=[\]{}]/}})(e)}const gc={'code[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"]::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},prolog:{color:"hsl(220, 10%, 40%)"},cdata:{color:"hsl(220, 10%, 40%)"},doctype:{color:"hsl(220, 14%, 71%)"},punctuation:{color:"hsl(220, 14%, 71%)"},entity:{color:"hsl(220, 14%, 71%)",cursor:"help"},"attr-name":{color:"hsl(29, 54%, 61%)"},"class-name":{color:"hsl(29, 54%, 61%)"},boolean:{color:"hsl(29, 54%, 61%)"},constant:{color:"hsl(29, 54%, 61%)"},number:{color:"hsl(29, 54%, 61%)"},atrule:{color:"hsl(29, 54%, 61%)"},keyword:{color:"hsl(286, 60%, 67%)"},property:{color:"hsl(355, 65%, 65%)"},tag:{color:"hsl(355, 65%, 65%)"},symbol:{color:"hsl(355, 65%, 65%)"},deleted:{color:"hsl(355, 65%, 65%)"},important:{color:"hsl(355, 65%, 65%)"},selector:{color:"hsl(95, 38%, 62%)"},string:{color:"hsl(95, 38%, 62%)"},char:{color:"hsl(95, 38%, 62%)"},builtin:{color:"hsl(95, 38%, 62%)"},inserted:{color:"hsl(95, 38%, 62%)"},regex:{color:"hsl(95, 38%, 62%)"},"attr-value":{color:"hsl(95, 38%, 62%)"},"attr-value > .token.punctuation":{color:"hsl(95, 38%, 62%)"},variable:{color:"hsl(207, 82%, 66%)"},operator:{color:"hsl(207, 82%, 66%)"},function:{color:"hsl(207, 82%, 66%)"},url:{color:"hsl(187, 47%, 55%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(220, 14%, 71%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(220, 14%, 71%)"},".language-css .token.selector":{color:"hsl(355, 65%, 65%)"},".language-css .token.property":{color:"hsl(220, 14%, 71%)"},".language-css .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.string.url":{color:"hsl(95, 38%, 62%)"},".language-css .token.important":{color:"hsl(286, 60%, 67%)"},".language-css .token.atrule .token.rule":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.operator":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(5, 48%, 51%)"},".language-json .token.operator":{color:"hsl(220, 14%, 71%)"},".language-json .token.null.keyword":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.url":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.operator":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.content":{color:"hsl(207, 82%, 66%)"},".language-markdown .token.url > .token.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.url-reference.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(95, 38%, 62%)"},".language-markdown .token.bold .token.content":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.italic .token.content":{color:"hsl(286, 60%, 67%)"},".language-markdown .token.strike .token.content":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.list.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(355, 65%, 65%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.cr:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.lf:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.space:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},".line-highlight.line-highlight":{background:"hsla(220, 100%, 80%, 0.04)"},".line-highlight.line-highlight:before":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(220, 100%, 80%, 0.04)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".command-line .command-line-prompt":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(220, 14%, 45%)"},".command-line .command-line-prompt > span:before":{color:"hsl(220, 14%, 45%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(286, 60%, 67%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(224, 13%, 17%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(224, 13%, 17%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(224, 13%, 17%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(224, 13%, 17%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(219, 13%, 22%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(220, 14%, 71%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(220, 14%, 71%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(220, 14%, 71%)"}};yt.registerLanguage("typescript",Uc);yt.registerLanguage("javascript",$s);yt.registerLanguage("tsx",ip);yt.registerLanguage("jsx",Fc);yt.registerLanguage("python",lp);yt.registerLanguage("bash",Xm);yt.registerLanguage("json",np);yt.registerLanguage("css",Bc);yt.registerLanguage("html",ui);yt.registerLanguage("markup",ui);yt.registerLanguage("xml",ui);yt.registerLanguage("sql",Vm);yt.registerLanguage("yaml",Pm);yt.registerLanguage("markdown",Qm);yt.registerLanguage("diff",Km);yt.registerLanguage("rust",ap);yt.registerLanguage("go",Jm);yt.registerLanguage("java",rp);yt.registerLanguage("c",Hc);yt.registerLanguage("cpp",Ym);yt.registerLanguage("ruby",Zm);yt.registerLanguage("toml",sp);yt.registerLanguage("scss",tp);yt.registerLanguage("graphql",ep);yt.registerLanguage("docker",Wm);const uO={code({className:e,children:n,...l}){const i=/language-(\w+)/.exec(e||"");if(!i&&!String(n).includes(`
106
- `))return u.jsx("code",{className:"bg-bg-tertiary px-1 py-0.5 rounded text-accent-secondary font-mono text-xs",...l,children:n});const c=(i==null?void 0:i[1])||"text",d=String(n).replace(/\n$/,"");return u.jsxs("div",{className:"relative group my-1.5",children:[u.jsx("div",{className:"absolute top-0 right-0 px-1.5 py-0.5 text-[10px] text-text-muted bg-bg-tertiary rounded-bl",children:c}),u.jsx(yt,{style:gc,language:c,PreTag:"div",customStyle:{margin:0,borderRadius:"0.375rem",fontSize:"0.75rem"},children:d})]})},p({children:e}){return u.jsx("p",{className:"mb-1.5 last:mb-0 leading-tight",children:e})},ul({children:e}){return u.jsx("ul",{className:"list-disc list-inside mb-1.5 space-y-0.5",children:e})},ol({children:e}){return u.jsx("ol",{className:"list-decimal list-inside mb-1.5 space-y-0.5",children:e})},li({children:e}){return u.jsx("li",{className:"text-text-primary text-sm list-item",children:e})},h1({children:e}){return u.jsx("h1",{className:"text-base font-bold mb-1.5 mt-2 first:mt-0 text-sky-400",children:e})},h2({children:e}){return u.jsx("h2",{className:"text-sm font-bold mb-1.5 mt-2 first:mt-0 text-sky-400",children:e})},h3({children:e}){return u.jsx("h3",{className:"text-sm font-bold mb-1.5 mt-1.5 first:mt-0 text-sky-400",children:e})},h4({children:e}){return u.jsx("h4",{className:"text-sm font-bold mb-1.5 mt-1.5 first:mt-0 text-sky-400",children:e})},strong({children:e}){return u.jsx("strong",{className:"font-bold text-amber-400",children:e})},a({href:e,children:n}){return u.jsx("a",{href:e,className:"text-accent-primary hover:underline text-sm",target:"_blank",rel:"noopener noreferrer",children:n})},blockquote({children:e}){return u.jsx("blockquote",{className:"border-l-2 border-accent-primary pl-2 my-1.5 text-text-secondary italic text-sm",children:e})},table({children:e}){return u.jsx("div",{className:"overflow-x-auto my-1.5",children:u.jsx("table",{className:"min-w-full border border-border",children:e})})},th({children:e}){return u.jsx("th",{className:"border border-border bg-bg-tertiary px-2 py-1 text-left font-semibold text-sm",children:e})},td({children:e}){return u.jsx("td",{className:"border border-border px-2 py-1 text-sm",children:e})},hr(){return u.jsx("hr",{className:"border-border my-2"})},input({checked:e,...n}){return u.jsx("input",{type:"checkbox",checked:e,disabled:!0,className:"mr-1.5 w-3.5 h-3.5",...n})}},$c=_.memo(function({content:n,className:l=""}){const i=_.useMemo(()=>{let s=dO(n);return s=fO(s),s},[n]);return u.jsx("div",{className:`markdown-content [&_li>p]:inline ${l}`,children:u.jsx(n5,{remarkPlugins:[h4],components:uO,children:i})})});function dO(e){let n=e.replace(/^(\s*)•\s/gm,"$1- ");return n=n.replace(/^(\d+)\.\s*\n(?=\S)/gm,"$1. "),n}function fO(e){const n=/```/g,l=e.match(n);if(((l==null?void 0:l.length)??0)%2===1){const s=e.lastIndexOf("```");return e.slice(s+3).includes(`
107
- `),e+"\n```"}return e}const mO=_.memo(function({content:n,variant:l="default"}){return l==="labeled"?u.jsxs("div",{className:"text-text-muted text-sm italic feed-item",children:[u.jsx("span",{className:"text-purple-400",children:"thinking:"}),u.jsx("div",{className:"ml-1.5 mt-0.5",children:u.jsx($c,{content:n})})]}):u.jsx("div",{className:"text-text-muted text-sm italic bg-bg-tertiary/50 rounded p-1.5 feed-item whitespace-pre-wrap",children:n})});function B1({tool:e,className:n="w-4 h-4 text-text-muted flex-shrink-0"}){return e==="glob"||e==="grep"?u.jsx("svg",{className:n,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}):e==="run_command"||e==="bash"?u.jsx("svg",{className:n,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}):u.jsx("svg",{className:n,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}const pO={...gc,'pre[class*="language-"]':{...gc['pre[class*="language-"]'],background:"transparent",whiteSpace:"pre-wrap",overflowWrap:"break-word",overflowX:"hidden"},'code[class*="language-"]':{...gc['code[class*="language-"]'],background:"transparent",whiteSpace:"pre-wrap",overflowWrap:"break-word"}},hO={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",php:"php",swift:"swift",kt:"kotlin",scala:"scala",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",ps1:"powershell",sql:"sql",html:"html",htm:"html",css:"css",scss:"scss",sass:"sass",less:"less",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",md:"markdown",markdown:"markdown",toml:"toml",ini:"ini",conf:"ini",dockerfile:"docker",makefile:"makefile",cmake:"cmake",graphql:"graphql",gql:"graphql",vue:"vue",svelte:"svelte"};function Gc(e){var s;if(!e)return"text";const n=e.split("/").pop()??"",l=n.toLowerCase();if(l==="dockerfile")return"docker";if(l==="makefile")return"makefile";if(l==="cmakelists.txt")return"cmake";const i=(s=n.split(".").pop())==null?void 0:s.toLowerCase();return i?hO[i]??"text":"text"}const H1={margin:0,padding:0,borderRadius:0,fontSize:"0.875rem",lineHeight:"1.5rem",background:"transparent",whiteSpace:"pre-wrap",overflowWrap:"break-word"},gO={...H1,display:"inline"},xO={margin:0,padding:0,borderRadius:0,fontSize:"0.875rem",lineHeight:"1.5rem",background:"transparent",whiteSpace:"pre-wrap",overflowWrap:"break-word"},Ms=_.memo(function({code:n,language:l,variant:i}){const s=i==="inline"?"span":i==="block-nowrap"?"div":"pre",c=i==="inline"?gO:i==="block-nowrap"?H1:xO;return u.jsx(yt,{style:pO,language:l,PreTag:s,customStyle:c,children:n})});function U1({src:e,alt:n,isOpen:l,onClose:i}){const s=_.useRef(null);_.useEffect(()=>{if(!l)return;const d=f=>{f.key==="Escape"&&i()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[l,i]);const c=d=>{d.target===d.currentTarget&&i()};return l?u.jsx("div",{ref:s,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",onClick:c,role:"dialog","aria-modal":"true","aria-label":"Image viewer",children:u.jsxs("div",{className:"relative max-w-[95vw] max-h-[95vh] flex items-center justify-center",children:[u.jsx("button",{onClick:i,className:"absolute -top-12 right-0 text-white hover:text-gray-300 transition-colors p-2","aria-label":"Close image viewer",children:u.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),u.jsx("img",{src:e,alt:n,className:"max-w-full max-h-[90vh] object-contain rounded-lg shadow-2xl"})]})}):null}const bO=_.memo(function({oldString:n,newString:l,filePath:i}){const s=_.useMemo(()=>Gc(i),[i]),c=n.split(`
108
- `),d=l.split(`
109
- `),f=n.length>0,p=l.length>0;return!f&&!p?u.jsx("div",{className:"text-xs text-text-muted italic p-2",children:"No changes"}):u.jsxs("div",{className:"rounded overflow-hidden border border-border grid grid-cols-[3px_1.5rem_1fr]",children:[f&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"bg-red-400/60"}),u.jsx("div",{className:"bg-red-950/30 text-red-400/70 text-sm font-mono text-center",children:c.map((m,x)=>u.jsx("div",{className:"leading-[1.5rem]",children:"-"},x))}),u.jsx("div",{className:"bg-red-950/30 pr-2 line-through decoration-red-400/30 overflow-x-auto min-w-0",children:u.jsx(Ms,{code:n,language:s,variant:"block-nowrap"})})]}),p&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"bg-green-400/60"}),u.jsx("div",{className:"bg-green-950/30 text-green-400/70 text-sm font-mono text-center",children:d.map((m,x)=>u.jsx("div",{className:"leading-[1.5rem]",children:"+"},x))}),u.jsx("div",{className:"bg-green-950/30 pr-2 overflow-x-auto min-w-0",children:u.jsx(Ms,{code:l,language:s,variant:"block-nowrap"})})]})]})}),yO=_.memo(function({content:n,filePath:l}){const i=_.useMemo(()=>Gc(l),[l]);return u.jsx("div",{className:"rounded overflow-hidden border border-border max-h-[45vh] overflow-y-auto",children:u.jsxs("div",{className:"grid grid-cols-[3px_1.5rem_1fr]",children:[u.jsx("div",{className:"bg-green-400/60"}),u.jsx("div",{className:"bg-green-950/30 text-green-400/70 text-sm font-mono text-center",children:n.split(`
110
- `).map((s,c)=>u.jsx("div",{className:"leading-[1.5rem]",children:"+"},c))}),u.jsx("div",{className:"bg-green-950/30 pr-2 min-w-0 overflow-x-hidden",children:u.jsx(Ms,{code:n,language:i,variant:"block"})})]})})}),vO=_.memo(function({regions:n,filePath:l}){const i=_.useMemo(()=>Gc(l),[l]);return n.length===0?u.jsx("div",{className:"text-xs text-text-muted italic p-2",children:"No changes"}):u.jsx("div",{className:"space-y-2",children:n.map((s,c)=>u.jsx(SO,{region:s,language:i},c))})}),SO=_.memo(function({region:n,language:l}){const i=wO(n),s=Math.max(...n.beforeContext.map(d=>d.lineNumber),...n.afterContext.map(d=>d.lineNumber),...n.edits.flatMap(d=>[d.startLine,d.endLine])),c=String(s).length;return u.jsx("div",{className:"rounded overflow-hidden border border-border font-mono text-sm",children:i.map((d,f)=>u.jsx(kO,{item:d,language:l,lineNumWidth:c},f))})});function wO(e){const n=[];for(const l of e.beforeContext)n.push({type:"context",lineNumber:l.lineNumber,content:l.content});for(const l of e.edits){const i=l.oldContent.split(`
111
- `);for(let c=0;c<i.length;c++)n.push({type:"removed",lineNumber:l.startLine+c,content:i[c]});const s=l.newContent.split(`
112
- `);for(let c=0;c<s.length;c++)n.push({type:"added",lineNumber:l.startLine+c,content:s[c]})}for(const l of e.afterContext)n.push({type:"context",lineNumber:l.lineNumber,content:l.content});return n}const kO=_.memo(function({item:n,language:l,lineNumWidth:i}){const s=String(n.lineNumber).padStart(i," "),c=n.type==="context"?"bg-bg-secondary":n.type==="removed"?"bg-red-950/30":"bg-green-950/30",d=n.type==="context"?"text-text-muted":n.type==="removed"?"text-red-400/70":"text-green-400/70",f=n.type==="context"?" ":n.type==="removed"?"-":"+",p=n.type==="removed"?"line-through decoration-red-400/30":"",m=n.type==="context"?"bg-transparent":n.type==="removed"?"bg-red-400/60":"bg-green-400/60";return u.jsxs("div",{className:`grid grid-cols-[3px_auto_1.25rem_1fr] ${c}`,children:[u.jsx("div",{className:m}),u.jsx("div",{className:"px-2 text-text-muted text-right select-none leading-[1.5rem]",children:s}),u.jsx("div",{className:`text-center select-none leading-[1.5rem] ${d}`,children:f}),u.jsx("div",{className:`pr-2 overflow-x-auto min-w-0 ${p}`,children:u.jsx(Ms,{code:n.content||" ",language:l,variant:"inline"})})]})}),jO=_.memo(function({result:n,metadata:l,filePath:i,heightExpanded:s=!1}){const[c,d]=_.useState(!1),f=_.useMemo(()=>Gc(i),[i]),p=l==null?void 0:l.mimeType,m=l==null?void 0:l.base64Data;if(p!=null&&p.startsWith("image/")&&m){const y=`data:${p};base64,${m}`;return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:`rounded overflow-hidden border border-border ${s?"":"max-h-[45vh]"} flex items-center justify-center cursor-pointer hover:border-accent-primary transition-colors`,onClick:()=>d(!0),children:u.jsx("img",{src:y,alt:i,className:"max-w-full max-h-[45vh] object-contain"})}),u.jsx(U1,{src:y,alt:i,isOpen:c,onClose:()=>d(!1)})]})}if(!n)return u.jsx("div",{className:"text-xs text-text-muted italic p-2",children:"Empty file"});const x=n.split(`
113
- `),b=x.filter(y=>!y.startsWith(`
114
- [`)&&!y.startsWith("[")).map(y=>y.replace(/^\d+: /,"")).join(`
115
- `);return u.jsx("div",{className:`rounded overflow-hidden border border-border ${s?"":"max-h-[45vh]"} overflow-y-auto`,children:u.jsxs("div",{className:"grid grid-cols-[2.5rem_1fr]",children:[u.jsx("div",{className:"bg-bg-tertiary text-text-muted text-xs font-mono text-right pr-2 select-none py-0.5",children:x.filter(y=>!y.startsWith(`
116
- [`)&&!y.startsWith("[")).map((y,v)=>{const w=y.match(/^(\d+): /);return u.jsx("div",{className:"leading-[1.5rem]",children:w?w[1]:v+1},v)})}),u.jsx("div",{className:"min-w-0 overflow-x-hidden py-0.5",children:u.jsx(Ms,{code:b,language:f,variant:"block"})})]})})}),NO={error:{icon:"✗",color:"text-accent-error",bg:"bg-red-500/10",border:"border-red-500/30"},warning:{icon:"⚠",color:"text-accent-warning",bg:"bg-yellow-500/10",border:"border-yellow-500/30"},info:{icon:"ℹ",color:"text-accent-info",bg:"bg-blue-500/10",border:"border-blue-500/30"},hint:{icon:"💡",color:"text-text-muted",bg:"bg-gray-500/10",border:"border-gray-500/30"}},u0=_.memo(function({diagnostics:n}){if(n.length===0)return null;const l=n.filter(c=>c.severity==="error"),i=n.filter(c=>c.severity==="warning"),s=n.filter(c=>c.severity==="info"||c.severity==="hint");return u.jsxs("div",{className:"rounded border border-border overflow-hidden mt-2",children:[u.jsxs("div",{className:"flex items-center gap-3 px-2 py-1.5 bg-bg-tertiary border-b border-border",children:[u.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"LSP Diagnostics"}),l.length>0&&u.jsxs("span",{className:"text-xs text-accent-error font-medium",children:[l.length," error",l.length!==1?"s":""]}),i.length>0&&u.jsxs("span",{className:"text-xs text-accent-warning font-medium",children:[i.length," warning",i.length!==1?"s":""]}),s.length>0&&u.jsxs("span",{className:"text-xs text-text-muted",children:[s.length," info"]})]}),u.jsx("div",{className:"max-h-48 overflow-y-auto",children:n.map((c,d)=>{const f=NO[c.severity];return u.jsxs("div",{className:`flex items-start gap-2 px-2 py-1.5 ${f.bg} border-b border-border last:border-b-0`,children:[u.jsx("span",{className:`${f.color} text-xs flex-shrink-0 w-4 text-center`,children:f.icon}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:"text-[10px] text-text-muted font-mono",children:["Ln ",c.range.start.line+1,":",c.range.start.character+1]}),c.code&&u.jsxs("span",{className:"text-[10px] text-text-muted font-mono",children:["[",c.code,"]"]})]}),u.jsx("div",{className:"text-xs text-text-primary break-words",children:c.message})]})]},d)})})]})}),d0={30:"text-black",31:"text-red-400",32:"text-accent-success",33:"text-accent-warning",34:"text-blue-400",35:"text-purple-400",36:"text-cyan-400",37:"text-gray-300",90:"text-gray-500",91:"text-red-500",92:"text-green-500",93:"text-yellow-400",94:"text-blue-500",95:"text-pink-400",96:"text-cyan-500",97:"text-white"},CO={40:"bg-black",41:"bg-red-900",42:"bg-green-900",43:"bg-yellow-900",44:"bg-blue-900",45:"bg-purple-900",46:"bg-cyan-900",47:"bg-gray-700"},f0={1:"font-bold",2:"opacity-75",4:"underline",7:"bg-bg-secondary"},EO="text-text-primary";function TO(e){const n=[],l=/\x1b\[([0-9;]+)m/g;let i=0,s="text-text-primary",c;try{for(;(c=l.exec(e))!==null;){if(c.index>i){const m=e.slice(i,c.index);m&&n.push({text:m,className:s})}const d=c[1];if(!d)continue;const f=d.split(";").map(Number);if(f.length===0||f[0]===0){s="text-text-primary";continue}const p=[];for(const m of f)if(m>=30&&m<=37){const x=d0[m];x&&p.push(x)}else if(m>=40&&m<=47){const x=CO[m];x&&p.push(x)}else if(m>=90&&m<=97){const x=d0[m];x&&p.push(x)}else if(m in f0){const x=f0[m];x&&p.push(x)}else m===39?p.push(EO):m===49&&(s=s.split(" ").filter(x=>!x.startsWith("bg-")).join(" "));p.length>0&&(s=p.join(" ")),i=l.lastIndex}if(i<e.length){const d=e.slice(i);d&&n.push({text:d,className:s})}return n}catch(d){return console.warn("ANSI parsing failed, stripping codes:",d),[{text:AO(e),className:"text-text-primary"}]}}function AO(e){return e.replace(/\x1b\[([0-9;]+)m/g,"")}function m0(e){var l,i;const n=TO(e);return n.length===1&&((l=n[0])==null?void 0:l.className)==="text-text-primary"?(i=n[0])==null?void 0:i.text:n.map((s,c)=>ke.createElement("span",{key:c,className:s.className},s.text))}const OO=_.memo(function({command:n,timeout:l,startedAt:i,streamingOutput:s,status:c,result:d,error:f,durationMs:p}){const m=_.useRef(null),[x,b]=_.useState(0);_.useEffect(()=>{m.current&&c==="pending"&&(m.current.scrollTop=m.current.scrollHeight)},[s,c]),_.useEffect(()=>{if(c!=="pending"||!i)return;const N=setInterval(()=>{b(Date.now()-i)},100);return()=>clearInterval(N)},[c,i]);const y=l/1e3,v=c==="pending"?x/1e3:(p??0)/1e3,w=c==="pending"?(s==null?void 0:s.map(N=>N.content).join(""))??"":d??"";return u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs flex-1 min-w-0",children:[u.jsx("span",{className:"text-text-muted flex-shrink-0",children:"$"}),u.jsx("code",{className:"text-text-primary break-all",children:n})]}),u.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-muted flex-shrink-0",children:[c==="pending"&&u.jsx("span",{className:"animate-pulse text-accent-warning",children:"running"}),c==="interrupted"&&u.jsx("span",{className:"text-red-400",children:"interrupted"}),u.jsxs("span",{className:c==="pending"?"text-text-secondary":"text-text-muted",children:[v.toFixed(1),"s / ",y,"s"]})]})]}),c==="pending"&&u.jsx("div",{className:"h-1 bg-bg-tertiary rounded overflow-hidden",children:u.jsx("div",{className:"h-full bg-accent-warning transition-all duration-100",style:{width:`${Math.min(100,x/l*100)}%`}})}),(w||c==="pending")&&u.jsx("pre",{ref:m,className:`text-xs bg-bg-primary p-2 rounded overflow-auto max-h-64 ${c==="pending"?"border border-accent-warning/30":""}`,children:c==="pending"&&s?s.map((N,j)=>u.jsx("span",{className:N.stream==="stderr"?"text-accent-warning":"",children:m0(N.content)},j)):m0(w)}),c==="error"&&f&&u.jsx("div",{className:"text-xs text-accent-error bg-accent-error/10 p-2 rounded",children:f}),c!=="pending"&&p!==void 0&&u.jsxs("div",{className:"text-[10px] text-text-muted",children:["Completed in ",(p/1e3).toFixed(2),"s"]})]})});function _O(e,n){if(e==="read_file"){const i=String(n.path??""),s=n.offset,c=n.limit,d=[];return s!==void 0&&s!==1&&d.push(`offset=${s}`),c!==void 0&&d.push(`limit=${c}`),d.length>0?`${i} [${d.join(", ")}]`:i}if(e==="write_file"||e==="edit_file")return String(n.path??"");if(e==="glob"||e==="grep")return String(n.pattern??"");if(e==="run_command"||e==="bash")return String(n.command??"");if(e==="return_value"){const i=String(n.content??"");return i.length>60?i.slice(0,60)+"...":i}const l=JSON.stringify(n);return l.length>50?l.slice(0,50)+"...":l}function p0(e,n,l){if(e==="glob"&&l){const i=String(n.pattern??""),s=n.cwd,c=l.totalFound,d=l.shownCount,f=l.truncated,p=[i];s&&p.push(`cwd=${s}`);const m=f?`Showing first ${d} of ${c}`:`${c} file(s) found`;return p.length===1?`${p[0]} [${m}]`:`${p[0]} [${p.slice(1).join(", ")}, ${m}]`}if(e==="grep"&&l){const i=String(n.pattern??""),s=n.include,c=n.cwd,d=l.totalMatches,f=l.shownCount,m=l.truncated?`Showing first ${f} of ${d} matches`:`${d} match(es) found`;return s&&c?`${i} [include=${s}] [cwd=${c}, ${m}]`:s?`${i} [include=${s}, ${m}]`:c?`${i} [cwd=${c}, ${m}]`:`${i} [${m}]`}return _O(e,n)}function RO(e){return JSON.stringify(e,null,2)}const MO={pending:{icon:"●",color:"text-accent-warning",animate:!0},success:{icon:"✓",color:"text-accent-success",animate:!1},error:{icon:"✗",color:"text-accent-error",animate:!1},interrupted:{icon:"✗",color:"text-red-400",animate:!1}},zO=_.memo(function({tool:n,args:l,status:i,variant:s="compact",result:c,error:d,durationMs:f,diagnostics:p,editContext:m,startedAt:x,streamingOutput:b,metadata:y}){const v=n==="edit_file"||n==="write_file",w=n==="run_command"&&i==="pending",N=n==="read_file",j=n==="return_value",[k,T]=_.useState(v||w||j),C=MO[i];return s==="compact"?u.jsxs("div",{className:"flex items-center gap-1.5 text-xs bg-bg-tertiary rounded px-2 py-1.5",children:[u.jsx(B1,{tool:n}),u.jsx("span",{className:"text-accent-primary font-medium",children:n}),u.jsx("span",{className:"text-text-muted truncate flex-1",children:p0(n,l,y)}),u.jsx("span",{className:`${C.color} ${C.animate?"animate-pulse":""}`,children:i==="pending"?"...":"done"})]}):u.jsxs("div",{className:"border border-border rounded overflow-hidden my-1 min-w-0",children:[u.jsxs("button",{className:"w-full flex items-center gap-1.5 p-2 bg-bg-tertiary hover:bg-bg-tertiary/80 text-left",onClick:()=>T(!k),children:[u.jsx("span",{className:`${C.color} ${C.animate?"animate-pulse":""}`,children:C.icon}),u.jsx("span",{className:"font-mono text-accent-primary text-sm",children:n}),u.jsx("span",{className:"text-text-muted text-xs flex-1 truncate",children:p0(n,l,y)}),u.jsx("span",{className:"text-text-muted text-xs",children:k?"▼":"▶"})]}),(k||N)&&u.jsxs("div",{className:"p-2 bg-bg-secondary border-t border-border space-y-2 min-w-0",children:[n==="run_command"&&u.jsx(OO,{command:String(l.command??""),timeout:l.timeout??12e4,startedAt:x,streamingOutput:b,status:i,result:c,error:d,durationMs:f}),n==="edit_file"&&i==="success"&&u.jsxs(u.Fragment,{children:[m&&m.regions.length>0?u.jsx(vO,{regions:m.regions,filePath:String(l.path??"")}):u.jsx(bO,{oldString:String(l.old_string??""),newString:String(l.new_string??""),filePath:String(l.path??"")}),p&&p.length>0&&u.jsx(u0,{diagnostics:p})]}),n==="write_file"&&i==="success"&&u.jsxs(u.Fragment,{children:[u.jsx(yO,{content:String(l.content??""),filePath:String(l.path??"")}),p&&p.length>0&&u.jsx(u0,{diagnostics:p})]}),n==="read_file"&&i==="success"&&u.jsx(jO,{result:c,metadata:y,filePath:String(l.path??""),heightExpanded:k}),n==="return_value"&&(()=>{const L=(b==null?void 0:b.map(I=>I.content).join(""))??"",G=i==="pending"&&L?L:String(l.content??"");return u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] text-accent-primary font-medium mb-1 uppercase tracking-wide",children:"Sub-Agent Summary"}),u.jsx("div",{className:"text-xs prose prose-invert prose-sm max-w-none",children:u.jsx($c,{content:G})})]})})(),n!=="edit_file"&&n!=="write_file"&&n!=="run_command"&&n!=="read_file"&&n!=="return_value"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] text-text-muted mb-0.5",children:"Arguments:"}),u.jsx("pre",{className:"text-xs bg-bg-primary p-1.5 rounded overflow-x-auto",children:RO(l)})]}),i==="success"&&c!==void 0&&u.jsxs("div",{children:[u.jsxs("div",{className:"text-[10px] text-text-muted mb-0.5",children:["Result",f!==void 0&&` (${f}ms)`,":"]}),u.jsx("pre",{className:"text-xs bg-bg-primary p-1.5 rounded overflow-x-auto max-h-32",children:c||"No output"})]})]}),i==="success"&&(n==="edit_file"||n==="write_file"||n==="read_file")&&f!==void 0&&u.jsxs("div",{className:"text-[10px] text-text-muted",children:["Completed in ",f,"ms"]}),i==="error"&&d&&n!=="run_command"&&u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] text-accent-error mb-0.5",children:"Error:"}),u.jsx("pre",{className:"text-xs bg-bg-primary p-1.5 rounded text-accent-error",children:d})]})]})]})}),DO={read_file:"Reading file",write_file:"Writing file",edit_file:"Editing file",run_command:"Running command",glob:"Searching files",grep:"Searching content",ask_user:"Asking user",add_criterion:"Adding criterion",update_criterion:"Updating criterion",remove_criterion:"Removing criterion",get_criteria:"Getting criteria",complete_criterion:"Completing criterion",pass_criterion:"Passing criterion",fail_criterion:"Failing criterion",todo_write:"Updating tasks"};function LO(e){return DO[e]??`Preparing ${e}`}const IO=_.memo(function({name:n}){const l=LO(n);return u.jsx("div",{className:"border border-border rounded overflow-hidden my-1 min-w-0 animate-pulse",children:u.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-bg-tertiary",children:[u.jsx("span",{className:"text-accent-warning animate-pulse",children:"..."}),u.jsx(B1,{tool:n}),u.jsx("span",{className:"font-mono text-accent-primary text-sm",children:n}),u.jsxs("span",{className:"text-text-muted text-xs flex-1",children:[l,"..."]})]})})}),BO={pending:{icon:"○",color:"text-text-muted"},in_progress:{icon:"●",color:"text-accent-warning",animate:!0},completed:{icon:"✓",color:"text-accent-success"}},HO=_.memo(function({todos:n}){return Array.isArray(n)?n.length===0?u.jsx("div",{className:"text-xs text-text-muted italic my-1",children:"No tasks"}):u.jsxs("div",{className:"my-1 rounded border border-border bg-bg-tertiary overflow-hidden",children:[u.jsx("div",{className:"px-2 py-1.5 border-b border-border bg-bg-secondary",children:u.jsx("span",{className:"text-xs font-medium text-text-muted",children:"Tasks"})}),u.jsx("div",{children:n.map((l,i)=>{const s=BO[l.status];return u.jsxs("div",{className:`flex items-start gap-2 px-2 py-1.5 ${i>0?"border-t border-border":""}`,children:[u.jsx("span",{className:`${(s==null?void 0:s.color)??"text-text-muted"} ${s!=null&&s.animate?"animate-pulse":""} text-sm leading-tight`,children:(s==null?void 0:s.icon)??"○"}),u.jsx("span",{className:`text-sm leading-tight ${l.status==="completed"?"text-text-muted":"text-text-primary"}`,children:l.content})]},i)})})]}):u.jsx("div",{className:"text-xs text-accent-warning italic my-1",children:"⚠️ Invalid todos data"})}),UO={add_criterion:{icon:"○",color:"text-text-muted"},update_criterion:{icon:"○",color:"text-text-muted"},remove_criterion:{icon:"○",color:"text-text-muted"},complete_criterion:{icon:"◉",color:"text-purple-400"},pass_criterion:{icon:"✓",color:"text-accent-success"},fail_criterion:{icon:"✗",color:"text-accent-error"}},F1=_.memo(function({toolCalls:n,criteria:l}){if(n.length===0)return null;const i=new Map((l==null?void 0:l.map(s=>[s.id,s]))??[]);return u.jsxs("div",{className:"my-1 rounded border border-border bg-bg-tertiary overflow-hidden",children:[u.jsx("div",{className:"px-2 py-1.5 border-b border-border bg-bg-secondary",children:u.jsx("span",{className:"text-xs font-medium text-text-muted",children:"Acceptance Criteria"})}),u.jsx("div",{children:n.map((s,c)=>{const d=s.name,f=UO[d]??{icon:"○",color:"text-text-muted"},p=s.arguments,m=p.id,x=p.description,b=m?i.get(m):void 0,y=x??(b==null?void 0:b.description)??"Criterion updated",v=p.reason,w=d==="remove_criterion",N=d==="fail_criterion";return u.jsxs("div",{className:`flex items-start gap-2 px-2 py-1.5 ${c>0?"border-t border-border":""}`,children:[u.jsx("span",{className:`${f.color} text-sm leading-tight flex-shrink-0`,children:f.icon}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("span",{className:`text-sm leading-tight ${w?"line-through text-text-muted":"text-text-primary"}`,children:y}),v&&u.jsxs("div",{className:`mt-1 text-sm ${N?"text-accent-error":"text-text-muted"}`,children:[u.jsx("span",{className:"text-text-muted",children:"└ "}),'"',v,'"']})]})]},s.id??c)})})]})});function FO(e){return["add_criterion","update_criterion","remove_criterion","complete_criterion","pass_criterion","fail_criterion"].includes(e)}function $O(e){const n=[];let l=[];const i=()=>{l.length>0&&(n.push({type:"criteria_group",toolCalls:l}),l=[])};for(const s of e)s.type==="tool_call"&&FO(s.toolCall.name)?l.push(s.toolCall):(i(),n.push(s));return i(),n}function GO(e,n){if(e.segments&&e.segments.length>0)return qO(e.segments,e.toolCalls??[],e.preparingToolCalls??[],e.stats,n);const l=[];if(e.thinkingContent&&l.push({type:"thinking",content:e.thinkingContent}),e.content&&l.push({type:"text",content:e.content}),e.toolCalls)for(const i of e.toolCalls)l.push({type:"tool_call",toolCall:i});if(e.preparingToolCalls)for(const i of e.preparingToolCalls)l.push({type:"preparing_tool_call",preparing:i});return n&&e.stats&&l.push({type:"stats",stats:e.stats}),l}function qO(e,n,l,i,s){const c=[],d=new Map(n.map(f=>[f.id,f]));for(const f of e)switch(f.type){case"text":c.push({type:"text",content:f.content});break;case"thinking":f.content&&f.content.trim().length>0&&c.push({type:"thinking",content:f.content});break;case"tool_call":{const p=d.get(f.toolCallId);p&&c.push({type:"tool_call",toolCall:p});break}}for(const f of l)c.push({type:"preparing_tool_call",preparing:f});return s&&i&&c.push({type:"stats",stats:i}),c}const op=_.memo(function({message:n,showStats:l=!0}){const i=Ae(f=>{var p;return(p=f.currentSession)==null?void 0:p.criteria}),s=bn(f=>f.agents),c=GO(n,l),d=$O(c);return d.length===0?null:u.jsx("div",{className:"feed-item",children:u.jsxs("div",{className:"min-w-0",children:[d.map((f,p)=>{var m,x;switch(f.type){case"thinking":return u.jsx(mO,{content:f.content},p);case"text":return u.jsx("div",{className:"prose prose-sm prose-invert max-w-none",children:u.jsx($c,{content:f.content})},p);case"preparing_tool_call":return u.jsx(IO,{name:f.preparing.name},`preparing-${f.preparing.index}`);case"tool_call":{const b=f.toolCall,y=b.result;if(b.name==="todo_write"){const N=b.arguments.todos,j=Array.isArray(N)?N:[];return u.jsx(HO,{todos:j},p)}const v=(m=y==null?void 0:y.output)==null?void 0:m.includes("[interrupted by user]"),w=y?v?"interrupted":y.success?"success":"error":"pending";return u.jsx(zO,{tool:b.name,args:b.arguments,status:w,variant:"expandable",result:y==null?void 0:y.output,error:y==null?void 0:y.error,durationMs:y==null?void 0:y.durationMs,diagnostics:y==null?void 0:y.diagnostics,editContext:y==null?void 0:y.editContext,startedAt:b.startedAt,streamingOutput:b.streamingOutput,metadata:y==null?void 0:y.metadata},p)}case"criteria_group":return u.jsx(F1,{toolCalls:f.toolCalls,criteria:i},p);case"stats":{const b=f.stats,y=((x=b.model.split("/").pop())==null?void 0:x.split("-").slice(0,2).join("-"))??b.model,v=xc(s,b.mode),w=j=>j>=1e3?`${(j/1e3).toFixed(1)}k`:j.toString(),N=j=>j>=1e3?`${(j/1e3).toFixed(1)}k`:j.toFixed(1);return u.jsxs("div",{className:"flex items-center justify-center gap-1.5 text-[10px] text-text-muted mt-3",children:[u.jsx("span",{className:"flex-1 h-px bg-border"}),u.jsx("span",{className:"text-text-secondary",children:y}),u.jsx("span",{className:"text-text-muted",children:"·"}),u.jsx("span",{style:{color:v},children:b.mode}),u.jsx("span",{className:"text-text-muted",children:"·"}),u.jsxs("span",{children:[b.totalTime.toFixed(1),"s"]}),b.toolTime>0&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-text-muted",children:"·"}),u.jsxs("span",{children:[b.toolTime.toFixed(1),"s tools"]})]}),u.jsx("span",{className:"text-text-muted",children:"·"}),u.jsxs("span",{children:[w(b.prefillTokens)," @ ",N(b.prefillSpeed)," pp"]}),u.jsx("span",{className:"text-text-muted",children:"·"}),u.jsxs("span",{children:[w(b.generationTokens)," @ ",N(b.generationSpeed)," tg"]}),u.jsx("span",{className:"flex-1 h-px bg-border"})]},p)}}}),n.partial&&u.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-accent-warning mt-1",children:[u.jsx("svg",{className:"w-2.5 h-2.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),u.jsx("span",{children:"Aborted"})]})]})})});function VO(e){if(e<60)return`${e}s`;const n=Math.floor(e/60),l=Math.round(e%60);return l>0?`${n}m ${l}s`:`${n}m`}function YO(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function h0(e,n){const l=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),s=parseInt(e.slice(5,7),16);return`rgba(${l},${i},${s},${n})`}const XO=_.memo(function({data:n}){var s;const i=((s=Ln(c=>c.workflows).find(c=>c.id===n.workflowId))==null?void 0:s.color)??n.workflowColor??"#8b949e";return u.jsxs("div",{className:"feed-item rounded p-3 border",style:{borderColor:h0(i,.3),backgroundColor:h0(i,.08)},children:[u.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[u.jsx("svg",{className:"w-3.5 h-3.5 shrink-0",fill:"none",stroke:i,viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),u.jsx("span",{className:"text-sm font-medium",style:{color:i},children:n.workflowName??"Task Completed"})]}),u.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-5 gap-2",children:[u.jsx(ms,{label:"Iterations",value:String(n.iterations)}),u.jsx(ms,{label:"Total time",value:VO(n.totalTimeSeconds)}),u.jsx(ms,{label:"Tool calls",value:String(n.totalToolCalls)}),u.jsx(ms,{label:"Tokens",value:YO(n.totalTokensGenerated)}),u.jsx(ms,{label:"Speed",value:n.avgGenerationSpeed>0?`${n.avgGenerationSpeed} tok/s`:"-"})]})]})});function ms({label:e,value:n}){return u.jsxs("div",{className:"bg-bg-primary/50 rounded px-2 py-1",children:[u.jsx("div",{className:"text-sm text-text-muted",children:e}),u.jsx("div",{className:"text-sm text-text-primary font-medium",children:n})]})}function g0(e,n){const l=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),s=parseInt(e.slice(5,7),16);return`rgba(${l},${i},${s},${n})`}const PO=_.memo(function({data:n}){var s;const i=((s=Ln(c=>c.workflows).find(c=>c.id===n.workflowId))==null?void 0:s.color)??n.workflowColor??"#6b7280";return u.jsxs("div",{className:"feed-item flex items-center gap-2 px-3 py-2 rounded border",style:{borderColor:g0(i,.3),backgroundColor:g0(i,.08)},children:[u.jsx("svg",{className:"w-3 h-3 shrink-0",fill:i,viewBox:"0 0 24 24",children:u.jsx("path",{d:"M8 5v14l11-7z"})}),u.jsx("span",{className:"text-sm font-medium",style:{color:i},children:n.workflowName}),u.jsx("span",{className:"text-text-muted text-sm",children:"started"})]})});function QO({attachments:e}){const[n,l]=_.useState(null),i=c=>{l(c)},s=()=>{l(null)};return e.length===0?null:u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mt-3 flex flex-wrap gap-3",children:e.map(c=>u.jsx("button",{onClick:()=>i(c.data),className:"group relative inline-block",title:c.filename,children:u.jsx("img",{src:c.data,alt:c.filename,className:"max-w-[256px] max-h-[256px] object-contain rounded-lg border border-border hover:border-accent-primary transition-colors cursor-pointer"})},c.id))}),n&&u.jsx(U1,{src:n,alt:"Attached image",isOpen:!0,onClose:s})]})}function ZO({isOpen:e,onClose:n,promptContext:l}){const[i,s]=_.useState({systemPrompt:!1,messages:!0,tools:!0,requestOptions:!0,injectedFiles:!0,userMessage:!0}),c=d=>{s(f=>({...f,[d]:!f[d]}))};return u.jsx(In,{isOpen:e,onClose:n,title:"Prompt Inspector",size:"lg",children:u.jsxs("div",{className:"space-y-4",children:[u.jsx(ta,{title:"User Message",expanded:i.userMessage??!0,onToggle:()=>c("userMessage"),children:u.jsx("pre",{className:"text-sm text-text-secondary whitespace-pre-wrap bg-bg-tertiary rounded p-3 max-h-48 overflow-auto",children:l.userMessage||"(empty)"})}),l.messages.length>0&&u.jsx(ta,{title:`Prompt Messages (${l.messages.length})`,expanded:i.messages??!0,onToggle:()=>c("messages"),children:u.jsx("div",{className:"space-y-2",children:l.messages.map((d,f)=>u.jsxs("div",{className:"border border-border rounded overflow-hidden",children:[u.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-bg-tertiary/50 text-xs text-text-muted",children:[u.jsx("span",{className:"font-mono text-text-primary",children:d.role}),u.jsx("span",{className:"rounded bg-bg-tertiary px-1.5 py-0.5",children:d.source}),d.toolCallId&&u.jsx("span",{className:"font-mono",children:d.toolCallId}),d.attachments&&d.attachments.length>0&&u.jsxs("span",{className:"rounded bg-bg-tertiary px-1.5 py-0.5",children:[d.attachments.length," attachment",d.attachments.length===1?"":"s"]})]}),d.attachments&&d.attachments.length>0&&u.jsx("div",{className:"border-b border-border px-3 py-2 text-xs text-text-muted",children:d.attachments.map(p=>p.filename).join(", ")}),u.jsx("pre",{className:"text-xs text-text-secondary whitespace-pre-wrap bg-bg-tertiary rounded-b p-3 max-h-64 overflow-auto font-mono",children:d.content||"(empty)"})]},`${d.role}-${f}`))})}),u.jsx(ta,{title:`Tools (${l.tools.length})`,expanded:i.tools??!0,onToggle:()=>c("tools"),children:u.jsxs("div",{className:"space-y-2",children:[l.tools.length===0&&u.jsx("div",{className:"text-sm text-text-muted",children:"No tools sent with this request."}),l.tools.map((d,f)=>u.jsxs("div",{className:"bg-bg-tertiary rounded p-3 space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsx("span",{className:"font-mono text-sm text-text-primary",children:d.name}),u.jsx("span",{className:"text-xs text-text-muted",children:"parameters"})]}),u.jsx("div",{className:"text-sm text-text-secondary",children:d.description}),u.jsx("pre",{className:"text-xs text-text-secondary whitespace-pre-wrap max-h-48 overflow-auto font-mono",children:JSON.stringify(d.parameters,null,2)})]},`${d.name}-${f}`))]})}),u.jsx(ta,{title:"Request Options",expanded:i.requestOptions??!0,onToggle:()=>c("requestOptions"),children:u.jsx("pre",{className:"text-xs text-text-secondary whitespace-pre-wrap bg-bg-tertiary rounded p-3 max-h-48 overflow-auto font-mono lowercase",children:JSON.stringify(l.requestOptions,null,2)})}),l.injectedFiles.length>0&&u.jsx(ta,{title:`Injected Files (${l.injectedFiles.length})`,expanded:i.injectedFiles??!0,onToggle:()=>c("injectedFiles"),children:u.jsx("div",{className:"space-y-2",children:l.injectedFiles.map((d,f)=>u.jsx(KO,{file:d,expanded:i[`file-${f}`]??!1,onToggle:()=>c(`file-${f}`)},f))})}),u.jsx(ta,{title:"System Prompt",expanded:i.systemPrompt??!1,onToggle:()=>c("systemPrompt"),badge:`${Math.round(l.systemPrompt.length/1e3)}K chars`,children:u.jsx("pre",{className:"text-xs text-text-secondary whitespace-pre-wrap bg-bg-tertiary rounded p-3 max-h-96 overflow-auto font-mono",children:l.systemPrompt})})]})})}function KO({file:e,expanded:n,onToggle:l}){return u.jsxs("div",{className:"bg-bg-tertiary rounded overflow-hidden",children:[u.jsxs("button",{onClick:l,className:"w-full flex items-center gap-2 p-2 hover:bg-bg-primary/30 transition-colors",children:[u.jsx("svg",{className:`w-3 h-3 text-text-muted transition-transform ${n?"rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),u.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${e.source==="global"?"bg-purple-500/20 text-purple-400":e.source==="project"?"bg-blue-500/20 text-blue-400":"bg-green-500/20 text-green-400"}`,children:e.source}),u.jsx("span",{className:"text-sm text-text-primary font-mono truncate flex-1 text-left",children:e.path}),e.content&&u.jsxs("span",{className:"text-xs text-text-muted",children:[Math.round(e.content.length/1e3),"K chars"]})]}),n&&e.content&&u.jsx("div",{className:"border-t border-border/50 p-2",children:u.jsx("pre",{className:"text-xs text-text-secondary whitespace-pre-wrap max-h-64 overflow-auto font-mono",children:e.content})})]})}function ta({title:e,expanded:n,onToggle:l,badge:i,children:s}){return u.jsxs("div",{className:"border border-border rounded overflow-hidden",children:[u.jsx("button",{onClick:l,className:"w-full flex items-center justify-between p-3 bg-bg-tertiary/50 hover:bg-bg-tertiary transition-colors",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("svg",{className:`w-4 h-4 text-text-muted transition-transform ${n?"rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),u.jsx("span",{className:"font-medium text-text-primary",children:e}),i&&u.jsx("span",{className:"text-xs text-text-muted bg-bg-tertiary px-1.5 py-0.5 rounded",children:i})]})}),n&&u.jsx("div",{className:"p-3 border-t border-border",children:s})]})}function WO({content:e,promptContext:n,align:l="right"}){const[i,s]=_.useState(!1),[c,d]=_.useState(!1),[f,p]=_.useState(!1),m=_.useRef(null);_.useEffect(()=>{const y=v=>{m.current&&!m.current.contains(v.target)&&s(!1)};return i&&document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[i]);const x=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(e);else{const y=document.createElement("textarea");y.value=e,y.style.position="fixed",y.style.left="-999999px",document.body.appendChild(y),y.select(),document.execCommand("copy"),document.body.removeChild(y)}p(!0),s(!1),window.setTimeout(()=>p(!1),1500)}catch(y){console.error("Failed to copy:",y)}},b=l==="right";return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:`flex items-start gap-1.5 ${b?"":"order-first"}`,children:[f&&u.jsx("svg",{className:"w-4 h-4 text-accent-success",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),u.jsxs("div",{ref:m,className:"relative",children:[u.jsx("button",{onClick:()=>s(!i),className:"p-1 rounded hover:bg-bg-tertiary text-text-muted hover:text-text-primary",title:"Message options",children:u.jsxs("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:[u.jsx("circle",{cx:"12",cy:"5",r:"2"}),u.jsx("circle",{cx:"12",cy:"12",r:"2"}),u.jsx("circle",{cx:"12",cy:"19",r:"2"})]})}),i&&u.jsxs("div",{className:`absolute top-full mt-1 bg-bg-secondary border border-border rounded shadow-xl z-50 py-1 min-w-36 ${b?"right-0":"left-0"}`,children:[u.jsxs("button",{onClick:x,className:"w-full px-3 py-1.5 text-left text-sm text-text-primary hover:bg-bg-tertiary flex items-center gap-2",children:[u.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),"Copy"]}),n&&u.jsxs("button",{onClick:()=>{d(!0),s(!1)},className:"w-full px-3 py-1.5 text-left text-sm text-text-primary hover:bg-bg-tertiary flex items-center gap-2",children:[u.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}),"Inspect"]})]})]})]}),n&&u.jsx(ZO,{isOpen:c,onClose:()=>d(!1),promptContext:n})]})}function JO({message:e,promptContext:n}){const l=e.messageKind==="auto-prompt",i=e.messageKind==="command",s=e.isSystemGenerated;return u.jsxs("div",{className:"flex justify-end items-start gap-1.5 feed-item",children:[!s&&u.jsx(WO,{content:e.content,promptContext:n,align:"right"}),u.jsxs("div",{className:`max-w-[75%] rounded p-2 ${s?i?"bg-teal-500/10 border border-teal-500/30":l?"bg-slate-500/10 border border-slate-500/30":"bg-amber-500/10 border border-amber-500/30":"bg-accent-primary/15 text-white"}`,children:[s&&u.jsx("span",{className:`text-[10px] block mb-0.5 ${i?"text-teal-400":l?"text-slate-400":"text-amber-400"}`,children:i?"Command":l?"Auto":"System"}),u.jsx("div",{className:`whitespace-pre-wrap text-sm ${s?`${i?"text-teal-200":l?"text-slate-200":"text-amber-200 italic"}`:""}`,children:e.content}),e.attachments&&e.attachments.length>0&&u.jsx(QO,{attachments:e.attachments})]})]})}const $1=_.memo(function({message:n,isLastAssistantMessage:l=!1,promptContext:i}){const s=n.role==="user",c=n.role==="assistant",d=n.role==="system",f=n.role==="tool";if(c)return u.jsx(op,{message:n,showStats:l});if(d&&n.isCompacted)return u.jsxs("div",{className:"feed-item bg-bg-tertiary/50 border border-border rounded p-2",children:[u.jsx("div",{className:"text-text-muted text-xs mb-0.5",children:"[Compacted]"}),u.jsx("div",{className:"text-text-secondary text-xs whitespace-pre-wrap",children:n.content.replace(`[COMPACTED HISTORY]
117
- `,"")})]});if(f)return u.jsxs("div",{className:"feed-item bg-bg-tertiary/30 border-l-2 border-accent-primary rounded-r p-2",children:[u.jsxs("div",{className:"text-accent-primary text-xs mb-0.5",children:["Tool: ",n.toolName]}),u.jsxs("pre",{className:"text-text-secondary text-xs whitespace-pre-wrap overflow-x-auto max-h-32",children:[n.content.slice(0,500),n.content.length>500&&"..."]})]});if(f)return u.jsxs("div",{className:"feed-item bg-bg-tertiary/30 border-l-2 border-accent-primary rounded-r p-2",children:[u.jsxs("div",{className:"text-accent-primary text-xs mb-0.5",children:["Tool: ",n.toolName]}),u.jsxs("pre",{className:"text-text-secondary text-xs whitespace-pre-wrap overflow-x-auto max-h-32",children:[n.content.slice(0,500),n.content.length>500&&"..."]})]});if(n.messageKind==="workflow-started")try{const p=JSON.parse(n.content);return u.jsx(PO,{data:p})}catch{}if(n.messageKind==="task-completed")try{const p=JSON.parse(n.content);return u.jsx(XO,{data:p})}catch{}return n.messageKind==="context-reset"?u.jsxs("div",{className:"flex items-center gap-4 mb-6 text-text-muted text-xs uppercase tracking-wide",children:[u.jsx("div",{className:"flex-1 border-t border-border"}),u.jsx("span",{children:n.content}),u.jsx("div",{className:"flex-1 border-t border-border"})]}):s?u.jsx(JO,{message:n,promptContext:i}):u.jsx("div",{className:"flex justify-start feed-item",children:u.jsx("div",{className:"max-w-[75%] rounded p-2 bg-bg-tertiary text-text-primary",children:u.jsx($c,{content:n.content})})})}),e_={verifier:"Verification",code_reviewer:"Code Review",test_generator:"Test Generation",debugger:"Debug"};function t_(e){return{backgroundColor:`${e}20`,color:e,borderColor:`${e}4d`}}const n_=_.memo(function({messages:n,subAgentType:l,isStreaming:i}){const s=_.useRef(null),c=_.useRef(null),[d,f]=_.useState(!1),[p,m]=_.useState(!1),x=bn(C=>C.agents),b=_.useCallback(()=>{const C=!p;m(C),C&&setTimeout(()=>{var L;(L=s.current)==null||L.scrollIntoView({block:"start",behavior:"smooth"})},220)},[p]),y=_.useCallback(()=>{const C=c.current;C&&(C.scrollTop=C.scrollHeight)},[]),v=_.useCallback(C=>{const L=c.current;L&&(C.deltaY<0?f(!0):C.deltaY>0&&d&&requestAnimationFrame(()=>{L.scrollHeight-L.scrollTop-L.clientHeight<50&&f(!1)}))},[d]);_.useEffect(()=>{d||y()},[n,d,y]),_.useEffect(()=>{i||f(!1)},[i]);const w=x.find(C=>C.id===l),N=(w==null?void 0:w.name)??e_[l]??l,j=xc(x,l),k=t_(j),T=n.filter(C=>C.role!=="tool");return u.jsxs("div",{ref:s,className:"feed-item border border-border rounded overflow-hidden bg-bg-secondary",children:[u.jsxs("button",{className:"w-full flex items-center justify-between px-2 py-1 text-xs font-medium border-b hover:opacity-80 transition-opacity",style:k,onClick:b,children:[u.jsx("span",{children:N}),u.jsx("span",{className:"text-[10px]",children:p?"▼":"▶"})]}),u.jsx("div",{ref:c,onWheel:v,className:`${p?"max-h-[calc(100vh-10rem)]":"max-h-80"} overflow-y-auto p-2 transition-[max-height] duration-200`,children:T.map(C=>C.role==="assistant"?u.jsx(op,{message:C,showStats:!0},C.id):u.jsx($1,{message:C,isLastAssistantMessage:!1},C.id))})]})});function r_(){const e=Ae(b=>{var y;return(y=b.currentSession)==null?void 0:y.mode}),n=Ae(b=>b.switchMode),l=bn(b=>b.agents),i=bn(b=>b.fetchAgents),[s,c]=_.useState(!1),d=_.useRef(null);if(_.useEffect(()=>{i()},[i]),_.useEffect(()=>{function b(y){d.current&&!d.current.contains(y.target)&&c(!1)}return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[]),!e)return null;const f=l.filter(b=>!b.subagent),p=f.find(b=>b.id===e),m=(p==null?void 0:p.name)??e,x=xc(l,e);return u.jsxs("div",{className:"relative",ref:d,children:[u.jsxs("button",{type:"button",onClick:()=>c(!s),className:"flex items-center gap-1 px-1.5 py-0.5 rounded hover:bg-bg-tertiary transition-colors",title:"Switch agent",children:[u.jsx("span",{className:"text-sm font-medium",style:{color:x},children:m}),u.jsx("svg",{className:`w-3 h-3 text-text-muted transition-transform ${s?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),s&&f.length>0&&u.jsx("div",{className:"absolute bottom-full left-0 mb-1 w-56 bg-bg-secondary border border-border rounded-lg shadow-lg overflow-hidden z-50",children:f.map(b=>{const y=b.id===e,v=xc(l,b.id);return u.jsxs("button",{type:"button",onClick:()=>{y||n(b.id),c(!1)},className:`w-full text-left px-3 py-2 text-sm transition-colors flex items-center gap-2 ${y?"bg-bg-tertiary":"hover:bg-bg-tertiary cursor-pointer"}`,children:[u.jsx("span",{className:"font-medium",style:{color:v},children:b.name}),y&&u.jsx("svg",{className:"w-3.5 h-3.5 text-text-muted ml-auto",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},b.id)})})]})}function l_(e){switch(e){case"sensitive_file":return{title:"Sensitive File Access",description:"is trying to access files that may contain secrets (API keys, passwords, credentials):",warning:"These files may contain sensitive information. Only allow access if you trust this operation."};case"both":return{title:"Sensitive File Access",description:"is trying to access sensitive files outside the project directory:",warning:"These files may contain secrets and are outside your project. Only allow access if you trust this operation."};case"outside_workdir":default:return{title:"Path Access Request",description:"is trying to access paths outside the project directory:",warning:"Allowing access will permit the tool to read, write, or execute commands involving these paths for this session."}}}function i_({confirmation:e}){const n=Ae(y=>y.confirmPath),{title:l,description:i,warning:s}=l_(e.reason),c=()=>{n(e.callId,!0)},d=()=>{n(e.callId,!1)},f=e.reason==="sensitive_file"||e.reason==="both",p=f?"text-red-400":"text-amber-400",m=f?"bg-red-500/10":"bg-amber-500/10",x=f?"text-red-300":"text-amber-300",b=f?"bg-red-600 hover:bg-red-700":"bg-amber-600 hover:bg-amber-700";return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:u.jsxs("div",{className:"bg-bg-secondary border border-border rounded shadow-xl max-w-lg w-full mx-4 overflow-hidden",children:[u.jsx("div",{className:`px-4 py-3 border-b border-border ${m}`,children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("svg",{className:`w-5 h-5 ${p}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),u.jsx("h2",{className:`text-sm font-semibold ${p}`,children:l})]})}),u.jsxs("div",{className:"px-4 py-3 space-y-3",children:[u.jsxs("p",{className:"text-sm text-text-secondary",children:["The tool ",u.jsx("code",{className:"px-1 py-0.5 bg-bg-tertiary rounded text-text-primary",children:e.tool})," ",i]}),u.jsx("div",{className:"bg-bg-tertiary rounded p-2 max-h-40 overflow-y-auto",children:u.jsx("ul",{className:"space-y-1",children:e.paths.map((y,v)=>u.jsx("li",{className:`text-xs font-mono ${x} break-all`,children:y},v))})}),u.jsxs("p",{className:"text-xs text-text-muted",children:["Project directory: ",u.jsx("code",{className:"px-1 py-0.5 bg-bg-tertiary rounded",children:e.workdir})]}),u.jsx("p",{className:"text-xs text-text-muted",children:s})]}),u.jsxs("div",{className:"px-4 py-3 border-t border-border flex justify-end gap-2",children:[u.jsx(gt,{variant:"secondary",size:"sm",onClick:d,children:"Deny"}),u.jsx(gt,{variant:"primary",size:"sm",onClick:c,className:b,children:"Allow Access"})]})]})})}function a_(){const e=pk(),n=e?"bg-amber-400":"bg-accent-primary";return u.jsxs("div",{className:"flex items-center gap-3 text-xs text-text-muted py-2",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsxs("span",{className:"flex gap-0.5",children:[u.jsx("span",{className:`w-1 h-1 rounded-full animate-bounce ${n}`,style:{animationDelay:"0ms"}}),u.jsx("span",{className:`w-1 h-1 rounded-full animate-bounce ${n}`,style:{animationDelay:"150ms"}}),u.jsx("span",{className:`w-1 h-1 rounded-full animate-bounce ${n}`,style:{animationDelay:"300ms"}})]}),u.jsx("span",{className:"text-text-secondary",children:e?"Running... (abort in progress)":"Running"})]}),!e&&u.jsx("span",{className:"text-text-muted",children:"esc to interrupt"})]})}function s_({attachment:e,onRemove:n}){const l=i=>i<1024?`${i} B`:i<1048576?`${(i/1024).toFixed(1)} KB`:`${(i/1048576).toFixed(1)} MB`;return u.jsxs("div",{className:"relative inline-flex flex-col items-center p-2 bg-bg-tertiary rounded-lg border border-border",children:[u.jsx("button",{onClick:()=>n(e.id),className:"absolute -top-2 -right-2 w-5 h-5 bg-accent-error text-white rounded-full flex items-center justify-center hover:bg-accent-error/80 transition-colors","aria-label":`Remove ${e.filename}`,children:u.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),u.jsx("img",{src:e.data,alt:e.filename,className:"w-16 h-16 object-cover rounded-md bg-bg-secondary"}),u.jsx("div",{className:"mt-1 text-xs text-text-muted text-center max-w-16 truncate",title:e.filename,children:e.filename}),u.jsx("div",{className:"text-[10px] text-text-muted",children:l(e.size)})]})}function o_({history:e,selectedIndex:n,onSelect:l,onEscape:i,onNavigate:s}){const c=_.useRef(null),d=_.useRef(null);_.useEffect(()=>{d.current&&c.current&&d.current.scrollIntoView({block:"nearest",behavior:"smooth"})},[n]);const f=m=>{switch(m.key){case"Enter":m.preventDefault(),e[n]&&l(e[n].content);break;case"Escape":m.preventDefault(),i();break;case"ArrowUp":m.preventDefault(),s("up");break;case"ArrowDown":m.preventDefault(),s("down");break}},p=m=>{l(m)};return u.jsx("div",{ref:c,role:"list",className:"mb-2 p-2 bg-bg-secondary border border-border rounded-lg overflow-y-auto max-h-64",onKeyDown:f,children:e.map((m,x)=>u.jsxs("div",{ref:x===n?d:null,role:"listitem",onClick:()=>p(m.content),className:`
118
- p-2 rounded cursor-pointer transition-colors
119
- ${x===n?"bg-accent-primary/20 border border-accent-primary":"hover:bg-bg-tertiary"}
120
- `,children:[u.jsxs("div",{className:"text-xs text-text-muted font-mono",children:[m.formattedTimestamp,m.sessionName&&u.jsxs(u.Fragment,{children:[" | ",u.jsx("span",{className:"text-accent-primary font-medium",children:m.sessionName})]})]}),u.jsx("div",{className:"text-sm text-text-primary mt-1",children:m.trimmedContent})]},m.id))})}const c_={maxWidth:1920,maxHeight:1920,quality:.85,maxSizeBytes:1048576};async function Hf(e,n={}){const l={...c_,...n};if(!e.type.startsWith("image/"))throw new Error("File is not an image");if(!["image/png","image/jpeg","image/gif"].includes(e.type))throw new Error(`Unsupported image format: ${e.type}. Only PNG, JPG, and GIF are supported.`);if(e.size<=l.maxSizeBytes){const s=await e.arrayBuffer(),c=g_(s),d=`data:${e.type};base64,${c}`,f=await G1(d);return{dataUrl:d,mimeType:e.type,size:e.size,width:f.width,height:f.height}}return await u_(e,l)}async function u_(e,n){const l=await f_(e),i=await G1(l),{width:s,height:c}=d_(i.width,i.height,n.maxWidth,n.maxHeight),d=m_();d.width=s,d.height=c;const f=d.getContext("2d");if(!f)throw new Error("Failed to get canvas context");f.imageSmoothingEnabled=!0,f.imageSmoothingQuality="high",f.drawImage(i,0,0,s,c);let p=n.quality,m;do{if(m=d.toDataURL(e.type.startsWith("image/gif")?"image/png":e.type,p),x0(m)<=n.maxSizeBytes||p<=.3)break;p-=.1}while(!0);const x=x0(m);return{dataUrl:m,mimeType:e.type.startsWith("image/gif")?"image/png":e.type,size:x,width:s,height:c}}function d_(e,n,l,i){const s=e/n;return e>n&&e>l?{width:l,height:Math.round(l/s)}:n>e&&n>i?{width:Math.round(i*s),height:i}:{width:e,height:n}}function f_(e){return new Promise((n,l)=>{const i=h_(),s=new i;s.onload=()=>n(s.result),s.onerror=()=>l(new Error("Failed to read file")),s.readAsDataURL(e)})}function G1(e){return new Promise((n,l)=>{const i=p_(),s=new i;s.onload=()=>n(s),s.onerror=()=>l(new Error("Failed to load image")),s.src=e})}function m_(){var n;const e=cp();if(!((n=e.document)!=null&&n.createElement))throw new Error("Image compression requires browser canvas APIs");return e.document.createElement("canvas")}function p_(){const e=cp();if(!e.Image)throw new Error("Image compression requires browser image APIs");return e.Image}function h_(){const e=cp();if(!e.FileReader)throw new Error("Image compression requires browser file APIs");return e.FileReader}function cp(){return globalThis}function g_(e){const n=new Uint8Array(e);let l="";for(let i=0;i<n.byteLength;i++){const s=n[i];s!==void 0&&(l+=String.fromCharCode(s))}return btoa(l)}function x0(e){const l=e.split(",")[1];return l?Math.round(l.length*3/4):0}function Uf(e){return["image/png","image/jpeg","image/gif"].includes(e.type)}function Ff(e,n=50*1024*1024){return e.size>n?{valid:!1,error:`Image file is too large (${b0(e.size)}). Maximum size is ${b0(n)}.`}:{valid:!0}}function b0(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function x_(e){const n={};let l=null;for(const i of e){if(i.role==="user"&&!i.isSystemGenerated){l=i.id;continue}i.role==="assistant"&&i.promptContext&&l&&n[l]===void 0&&(n[l]=i.promptContext)}return n}function b_(){var X;const e=Ae(U=>U.currentSession),n=Ae(U=>U.setSessionProvider),[l,i]=_.useState(!1),[s,c]=_.useState([]),[d,f]=_.useState({}),[p,m]=_.useState(null),x=_.useRef(null),b=Nn(U=>U.providers),y=Nn(U=>U.activeProviderId),v=Nn(U=>U.model);Nn(U=>U.backend);const w=Nn(U=>U.llmStatus),N=Nn(U=>U.activating),j=Nn(U=>U.activateProvider),k=Nn(U=>U.refreshModel);_.useEffect(()=>{function U(D){x.current&&!x.current.contains(D.target)&&(i(!1),c([]))}return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[]),_.useEffect(()=>{if(l){const U=b.map(D=>D.id);c(U),U.forEach(D=>{d[D]||L(D)})}},[l,b]),b.find(U=>U.id===y);const T=w==="disconnected",C=v?((X=v.split("/").pop())==null?void 0:X.replace(/-/g," "))??v:"detecting...",L=async U=>{if(d[U])return d[U];m(U);try{const D=await fetch(`/api/providers/${U}/models`);if(D.ok){const Q=await D.json();return f(M=>({...M,[U]:Q.models})),Q.models}}catch{}finally{m(null)}return null},G=async U=>{if(U.id===y){s.includes(U.id)?c(s.filter(D=>D!==U.id)):(c([...s,U.id]),L(U.id));return}e?(n(U.id,void 0),Nn.getState().syncFromSession(U.id,""),i(!1),c([])):await j(U.id)&&(i(!1),c([]))},I=U=>{s.includes(U.id)?c(s.filter(D=>D!==U.id)):(c([...s,U.id]),L(U.id))},R=async(U,D)=>{if(e){n(U,D),Nn.getState().syncFromSession(U,D),c([]),i(!1);return}m("activating");try{(await fetch(`/api/providers/${U}/activate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:D})})).ok&&(await Nn.getState().fetchConfig(),c([]),i(!1))}catch{}finally{m(null)}};return b.length===0?u.jsxs("button",{type:"button",onClick:()=>k(),className:"flex items-center gap-1 px-1.5 py-0.5 rounded hover:bg-bg-tertiary transition-colors group",title:T?"LLM server is offline. Click to retry.":v??"Click to refresh model",children:[T?u.jsx("span",{className:"text-sm text-accent-error animate-pulse",children:"LLM offline"}):u.jsx("span",{className:"text-sm text-accent-primary",children:C}),u.jsx("span",{className:"text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:"↻"})]}):u.jsxs("div",{className:"relative",ref:x,children:[u.jsxs("button",{type:"button",onClick:()=>i(!l),className:"flex items-center gap-1 px-1.5 py-0.5 rounded hover:bg-bg-tertiary transition-colors group",title:"Click to switch provider or model",children:[T?u.jsx("span",{className:"text-sm text-accent-error animate-pulse",children:"offline"}):u.jsx("span",{className:"text-sm text-accent-primary",children:C}),u.jsx("svg",{className:`w-3 h-3 text-text-muted transition-transform ${l?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),l&&u.jsxs("div",{className:"absolute bottom-full right-0 mb-1 w-72 bg-bg-secondary border border-border rounded-lg shadow-lg z-50 overflow-hidden",children:[u.jsx("div",{className:"py-1",children:b.map(U=>{var D;return u.jsxs("div",{children:[u.jsxs("div",{className:`px-3 py-2 flex items-center justify-between ${U.id===y?"bg-bg-tertiary":"hover:bg-bg-tertiary"} ${N?"opacity-50 cursor-wait":"cursor-pointer"}`,children:[u.jsxs("div",{onClick:()=>!N&&G(U),className:"flex flex-col min-w-0 flex-1 cursor-pointer",children:[u.jsx("span",{className:`text-sm font-medium truncate ${U.id===y?"text-accent-primary":"text-text-primary"}`,children:U.name}),u.jsx("span",{className:"text-xs text-text-muted truncate",children:U.backend!=="auto"&&Qw(U.backend)})]}),u.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[U.id===y?u.jsx("span",{className:"text-accent-success",title:"Active",children:u.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})}):u.jsx("span",{className:"w-4"}),u.jsx("button",{type:"button",onClick:Q=>{Q.stopPropagation(),I(U)},className:"p-0.5 hover:bg-bg-tertiary rounded transition-colors",title:"Show models",children:u.jsx("svg",{className:`w-4 h-4 transition-transform ${s.includes(U.id)?"rotate-180":""} ${U.id===y?"text-accent-primary":"text-text-muted"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]}),s.includes(U.id)&&u.jsx("div",{className:"bg-bg-primary border-t border-border",children:p===U.id?u.jsx("div",{className:"px-4 py-2 text-xs text-text-muted",children:"Loading models..."}):(D=d[U.id])!=null&&D.length?d[U.id].map(Q=>{var M;return u.jsxs("button",{type:"button",onClick:()=>R(U.id,Q),disabled:p==="activating",className:`w-full px-4 py-1.5 text-left hover:bg-bg-tertiary transition-colors text-sm flex items-center justify-between ${p==="activating"?"opacity-50 cursor-wait":""} ${v===Q?"text-accent-primary":"text-text-secondary"}`,children:[u.jsx("span",{className:"truncate",children:((M=Q.split("/").pop())==null?void 0:M.replace(/-/g," "))??Q}),v===Q&&u.jsx("span",{className:"text-accent-success flex-shrink-0",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]},Q)}):u.jsx("div",{className:"px-4 py-2 text-xs text-text-muted",children:"No models available"})})]},U.id)})}),u.jsx("div",{className:"border-t border-border px-3 py-2",children:u.jsxs("p",{className:"text-xs text-text-muted",children:["Use ",u.jsx("code",{className:"bg-bg-tertiary px-1 rounded",children:"openfox provider add"})," to add more providers"]})})]})]})}const Pn=Kr((e,n)=>({commands:[],defaultIds:[],modifiedIds:[],loading:!1,fetchDefaultIds:async()=>{try{const i=await(await fetch("/api/commands/default-ids")).json();e({defaultIds:i.ids??[]})}catch{}},fetchCommands:async()=>{e({loading:!0});try{const i=await(await fetch("/api/commands")).json();e({commands:i.commands??[],defaultIds:i.defaultIds??n().defaultIds,modifiedIds:i.modifiedIds??[],loading:!1})}catch{e({loading:!1})}},fetchCommand:async l=>{try{const i=await fetch(`/api/commands/${l}`);return i.ok?await i.json():null}catch{return null}},createCommand:async l=>{try{const i=await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});return i.ok?(await n().fetchCommands(),{success:!0}):{success:!1,error:(await i.json()).error}}catch{return{success:!1,error:"Network error"}}},updateCommand:async(l,i)=>{try{const s=await fetch(`/api/commands/${l}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return s.ok?(await n().fetchCommands(),{success:!0}):{success:!1,error:(await s.json()).error}}catch{return{success:!1,error:"Network error"}}},deleteCommand:async l=>{try{return(await fetch(`/api/commands/${l}`,{method:"DELETE"})).ok?(e({commands:n().commands.filter(s=>s.id!==l)}),!0):!1}catch{return!1}},restoreDefault:async l=>{try{return(await fetch(`/api/commands/${l}/restore-default`,{method:"POST"})).ok?(await n().fetchCommands(),!0):!1}catch{return!1}},restoreAllDefaults:async()=>{try{return(await fetch("/api/commands/restore-all-defaults",{method:"POST"})).ok?(await n().fetchCommands(),!0):!1}catch{return!1}}}));function y_({onSendCommand:e,onOpenManager:n}){const[l,i]=_.useState(!1),[s,c]=_.useState(""),[d,f]=_.useState(0),p=_.useRef(null),m=_.useRef(null),x=Pn(j=>j.commands),b=Pn(j=>j.fetchCommands);_.useEffect(()=>{l&&(b(),c(""),f(0),requestAnimationFrame(()=>{var j;return(j=m.current)==null?void 0:j.focus()}))},[l,b]),_.useEffect(()=>{if(!l)return;const j=k=>{p.current&&!p.current.contains(k.target)&&i(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[l]);const y=x.filter(j=>{if(!s)return!0;const k=s.toLowerCase();return j.name.toLowerCase().includes(k)}),v=j=>{switch(j.key){case"ArrowDown":j.preventDefault(),f(k=>Math.min(k+1,y.length-1));break;case"ArrowUp":j.preventDefault(),f(k=>Math.max(k-1,0));break;case"Enter":j.preventDefault(),y[d]&&w(y[d].id);break;case"Escape":j.preventDefault(),i(!1);break}},w=async j=>{const k=await Pn.getState().fetchCommand(j);k&&e(k.prompt,k.metadata.agentMode),i(!1)},N=()=>{i(!1),n()};return u.jsxs("div",{ref:p,className:"relative",children:[u.jsx("button",{type:"button",onClick:()=>i(j=>!j),className:"text-sm text-text-muted hover:text-text-primary transition-colors",children:"Commands ›"}),l&&u.jsxs("div",{className:"absolute bottom-full right-0 mb-1 w-72 bg-bg-secondary border border-border rounded-lg shadow-xl z-50",onKeyDown:v,children:[u.jsx("div",{className:"p-2 border-b border-border",children:u.jsx("input",{ref:m,value:s,onChange:j=>{c(j.target.value),f(0)},placeholder:"Search commands...",className:"w-full px-2 py-1 bg-bg-tertiary border border-border rounded text-sm focus:outline-none focus:ring-1 focus:ring-accent-primary"})}),u.jsx("div",{className:"overflow-y-auto max-h-64 p-1",children:y.length===0?u.jsx("div",{className:"px-3 py-2 text-text-muted text-sm",children:x.length===0?"No commands yet":"No matches"}):y.map((j,k)=>u.jsx("button",{type:"button",onClick:()=>w(j.id),className:`w-full text-left px-3 py-2 rounded transition-colors ${k===d?"bg-accent-primary/20":"hover:bg-bg-tertiary"}`,children:u.jsx("div",{className:"text-sm text-text-primary font-medium",children:j.name})},j.id))}),u.jsx("div",{className:"border-t border-border p-1",children:u.jsx("button",{type:"button",onClick:N,className:"w-full text-left px-3 py-1.5 rounded text-sm text-text-muted hover:text-text-primary hover:bg-bg-tertiary transition-colors",children:"Manage Commands..."})})]})]})}function v_(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function S_({isOpen:e,onClose:n}){const l=Pn(Y=>Y.commands),i=Pn(Y=>Y.modifiedIds),s=Pn(Y=>Y.loading),c=Pn(Y=>Y.fetchCommands),d=Pn(Y=>Y.fetchCommand),f=Pn(Y=>Y.createCommand),p=Pn(Y=>Y.updateCommand),m=Pn(Y=>Y.deleteCommand),x=Pn(Y=>Y.restoreDefault),b=Pn(Y=>Y.restoreAllDefaults),[y,v]=_.useState("list"),[w,N]=_.useState(null),[j,k]=_.useState(null),T=bn(Y=>Y.agents),C=bn(Y=>Y.fetchAgents),L=T.filter(Y=>!Y.subagent),[G,I]=_.useState(""),[R,X]=_.useState(""),[U,D]=_.useState(""),[Q,M]=_.useState(""),[V,H]=_.useState(""),[q,B]=_.useState(!1),[P,oe]=_.useState(null),[ae,A]=_.useState(!1);_.useEffect(()=>{e&&(c(),C(),v("list"),N(null),k(null),oe(null),A(!1))},[e,c,C]);const z=()=>{N(null),I(""),X(""),D(""),M(""),H(""),v("edit")},W=async Y=>{const le=await d(Y);le&&(N(Y),I(le.metadata.name),X(le.metadata.id),D(le.prompt),M(le.metadata.agentMode??""),H(""),v("edit"))},O=async Y=>{await m(Y),k(null)},$=async()=>{const Y=w??R;if(!Y||!G||!U){H("Name and message are required.");return}B(!0),H("");const le={metadata:{id:Y,name:G,...Q?{agentMode:Q}:{}},prompt:U},xe=w?await p(w,le):await f(le);if(B(!1),!xe.success){H(xe.error??"Failed to save command.");return}v("list")},ee=()=>{v("list")},re=Y=>{I(Y),w||X(v_(Y))};return y==="edit"?u.jsx(In,{isOpen:e,onClose:ee,title:w?"Edit Command":"New Command",size:"lg",children:u.jsxs("div",{className:"space-y-3",children:[V&&u.jsx("div",{className:"text-accent-error text-sm px-3 py-2 bg-accent-error/10 rounded",children:V}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs text-text-secondary mb-1",children:"Name"}),u.jsx("input",{value:G,onChange:Y=>re(Y.target.value),placeholder:"My Command",className:"w-full px-2 py-1.5 bg-bg-tertiary border border-border rounded text-sm focus:outline-none focus:ring-1 focus:ring-accent-primary"})]}),u.jsxs("div",{children:[u.jsxs("label",{className:"block text-xs text-text-secondary mb-1",children:["ID ",w&&u.jsx("span",{className:"text-text-muted",children:"(read-only)"})]}),u.jsx("input",{value:R,onChange:Y=>!w&&X(Y.target.value),readOnly:!!w,placeholder:"my-command",className:`w-full px-2 py-1.5 bg-bg-tertiary border border-border rounded text-sm font-mono focus:outline-none focus:ring-1 focus:ring-accent-primary ${w?"opacity-60":""}`})]})]}),u.jsxs("div",{children:[u.jsxs("label",{className:"block text-xs text-text-secondary mb-1",children:["Agent Mode ",u.jsx("span",{className:"text-text-muted",children:"(optional)"})]}),u.jsxs("select",{value:Q,onChange:Y=>M(Y.target.value),className:"w-full px-2 py-1.5 bg-bg-tertiary border border-border rounded text-sm focus:outline-none focus:ring-1 focus:ring-accent-primary",children:[u.jsx("option",{value:"",children:"None (keep current mode)"}),L.map(Y=>u.jsx("option",{value:Y.id,children:Y.name},Y.id))]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs text-text-secondary mb-1",children:"Message"}),u.jsx("textarea",{value:U,onChange:Y=>D(Y.target.value),placeholder:"The message that will be sent when this command is triggered...",className:"w-full h-64 px-3 py-2 bg-bg-tertiary border border-border rounded text-sm font-mono resize-none focus:outline-none focus:ring-1 focus:ring-accent-primary"})]}),u.jsxs("div",{className:"flex justify-end gap-2 pt-2 border-t border-border",children:[u.jsx(gt,{variant:"secondary",onClick:ee,children:"Cancel"}),u.jsx(gt,{variant:"primary",onClick:$,disabled:q||!G||!U,children:q?"Saving...":"Save"})]})]})}):u.jsxs(In,{isOpen:e,onClose:n,title:"Commands",size:"md",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("p",{className:"text-text-secondary text-sm",children:"Commands are pre-defined messages you can send with a single click."}),u.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 ml-3",children:[i.length>0&&(ae?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:async()=>{await b(),A(!1)},className:"px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400 text-xs hover:bg-amber-500/30 transition-colors",children:"Confirm"}),u.jsx("button",{onClick:()=>A(!1),className:"px-1.5 py-0.5 rounded text-text-muted text-xs hover:bg-bg-primary transition-colors",children:"Cancel"})]}):u.jsx("button",{onClick:()=>A(!0),className:"px-2 py-1 rounded text-xs text-text-muted hover:text-amber-400 hover:bg-amber-500/10 transition-colors",title:"Restore all commands to defaults",children:"Restore Defaults"})),u.jsx(gt,{variant:"primary",size:"sm",onClick:z,children:"+ New"})]})]}),s&&l.length===0?u.jsx("div",{className:"text-text-muted text-sm",children:"Loading commands..."}):l.length===0?u.jsx("div",{className:"text-text-muted text-sm",children:"No commands created yet."}):u.jsx("div",{className:"space-y-2",children:l.map(Y=>u.jsxs("div",{className:"flex items-center justify-between p-3 rounded border border-border bg-bg-tertiary",children:[u.jsx("div",{className:"min-w-0 flex-1 mr-3",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-text-primary text-sm font-medium",children:Y.name}),i.includes(Y.id)&&u.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-amber-500/15 text-amber-400",children:"modified"})]})}),u.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[i.includes(Y.id)&&(P===Y.id?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:async()=>{await x(Y.id),oe(null)},className:"px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400 text-xs hover:bg-amber-500/30 transition-colors",children:"Restore"}),u.jsx("button",{onClick:()=>oe(null),className:"px-1.5 py-0.5 rounded text-text-muted text-xs hover:bg-bg-primary transition-colors",children:"Cancel"})]}):u.jsx("button",{onClick:()=>oe(Y.id),className:"p-1.5 rounded hover:bg-bg-primary text-text-muted hover:text-amber-400 transition-colors",title:"Restore default",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})),u.jsx("button",{onClick:()=>W(Y.id),className:"p-1.5 rounded hover:bg-bg-primary text-text-muted hover:text-text-primary transition-colors",title:"Edit command",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),j===Y.id?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:()=>O(Y.id),className:"px-1.5 py-0.5 rounded bg-accent-error/20 text-accent-error text-xs hover:bg-accent-error/30 transition-colors",children:"Delete"}),u.jsx("button",{onClick:()=>k(null),className:"px-1.5 py-0.5 rounded text-text-muted text-xs hover:bg-bg-primary transition-colors",children:"Cancel"})]}):u.jsx("button",{onClick:()=>k(Y.id),className:"p-1.5 rounded hover:bg-bg-primary text-text-muted hover:text-accent-error transition-colors",title:"Delete command",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]},Y.id))})]})}function w_(e){return e.startsWith("criteria_")}function k_(e){var n,l;return e.role!=="assistant"||e.subAgentId||(n=e.content)!=null&&n.trim()||(l=e.thinkingContent)!=null&&l.trim()||!e.toolCalls||e.toolCalls.length===0?!1:e.toolCalls.every(i=>w_(i.name))}function j_(e,n=[]){const l=[];let i=null,s=[],c,d=1;const f=new Map,p=new Map,m=[];for(const v of n)v.type==="message"?f.set(v.message.id,v):v.type==="subagent"?p.set(v.subAgentId,v):v.type==="criteria-batch"&&m.push(v);let x=0;const b=()=>{if(s.length>0){const v=m[x];v&&v.type==="criteria-batch"&&v.toolCalls.length===s.length&&v.toolCalls.every((N,j)=>{var k;return N.id===((k=s[j])==null?void 0:k.id)})?l.push(v):l.push({type:"criteria-batch",toolCalls:[...s]}),x++,s=[]}},y=()=>{if(!i)return;const v=i,w=p.get(v.subAgentId);w&&w.type==="subagent"&&w.messages.length===v.messages.length&&w.messages.every((j,k)=>j===v.messages[k])?l.push(w):l.push({type:"subagent",subAgentId:v.subAgentId,subAgentType:v.subAgentType,messages:v.messages}),i=null};for(const v of e)if(v.role!=="tool"){if(v.contextWindowId&&c&&v.contextWindowId!==c&&(b(),y(),d++,l.push({type:"context-divider",windowSequence:d})),c=v.contextWindowId,k_(v)){y();for(const w of v.toolCalls)s.push(w);continue}if(b(),v.subAgentId&&v.subAgentType)i&&i.subAgentId===v.subAgentId?i.messages.push(v):(y(),i={subAgentId:v.subAgentId,subAgentType:v.subAgentType,messages:[v]});else{y();const w=f.get(v.id);w&&w.type==="message"&&w.message===v?l.push(w):l.push({type:"message",message:v})}}return b(),y(),l}function N_(e){const n=new Date(e),l=n.getFullYear(),i=String(n.getMonth()+1).padStart(2,"0"),s=String(n.getDate()).padStart(2,"0"),c=String(n.getHours()).padStart(2,"0"),d=String(n.getMinutes()).padStart(2,"0");return`${l}/${i}/${s} ${c}:${d}`}function C_(e,n){return e.length<=n?e:e.substring(0,n)+"..."}const E_=10,T_=150;function A_(e,n,l){const i=[],s=e.filter(f=>f.role==="user"&&!f.isSystemGenerated&&f.messageKind!=="auto-prompt");for(const f of s)i.push({id:f.id,content:f.content,timestamp:f.timestamp,sessionId:l,sessionName:"This session"});for(const f of n)if(!(l&&f.id===l)&&f.recentUserPrompts)for(const p of f.recentUserPrompts)i.push({id:p.id,content:p.content,timestamp:p.timestamp,sessionId:f.id,sessionName:f.title||f.id});i.sort((f,p)=>new Date(p.timestamp).getTime()-new Date(f.timestamp).getTime());const c=i.slice(0,E_);c.reverse();const d=[];for(const f of c)d.push({id:f.id,content:f.content,timestamp:f.timestamp,formattedTimestamp:N_(f.timestamp),trimmedContent:C_(f.content,T_),sessionId:f.sessionId||void 0,sessionName:f.sessionName});return d}function O_(e,n=[],l=null){const[i,s]=_.useState(0),[c,d]=_.useState(!1),f=_.useMemo(()=>A_(e,n,l),[e,n,l]),p=_.useCallback(()=>{f.length>0&&(s(f.length-1),d(!0))},[f.length]),m=_.useCallback(()=>{d(!1),s(0)},[]),x=_.useCallback(()=>{s(v=>f.length===0?v:v===0?f.length-1:v-1)},[f.length]),b=_.useCallback(()=>{s(v=>f.length===0?v:v===f.length-1?0:v+1)},[f.length]),y=_.useCallback(()=>{if(f.length===0||!c)return null;const v=f[i];return(v==null?void 0:v.content)??null},[f,i,c]);return{history:f,selectedIndex:i,showHistory:c,openHistory:p,closeHistory:m,navigateUp:x,navigateDown:b,selectCurrent:y}}function __(){const[e,n]=_.useState(!0),[l,i]=_.useState(""),s=_.useRef(!0),[c,d]=_.useState([]),[f,p]=_.useState(!1),[m,x]=_.useState(null),[b,y]=_.useState(!1),v=_.useRef(null),w=_.useRef(null),N=_.useRef(null),j=Ae(K=>K.currentSession),k=Ae(K=>K.messages),T=Ae(K=>K.streamingMessage),C=Ae(K=>K.sessions),L=Ae(K=>K.error),G=Ae(K=>K.pendingPathConfirmation),I=fk(),R=Ae(K=>K.sendMessage),X=Ae(K=>K.clearError),U=Ae(K=>K.acceptAndBuild),D=Ae(K=>K.stopGeneration),Q=Ae(K=>K.launchRunner),M=Ae(K=>K.queueAsap),V=Ae(K=>K.queueCompletion),H=Ae(K=>K.cancelQueued),q=mk(),B=Ln(K=>K.workflows),P=Ln(K=>K.fetchWorkflows);_.useEffect(()=>{P()},[P]);const{history:oe,selectedIndex:ae,showHistory:A,openHistory:z,closeHistory:W,navigateUp:O,navigateDown:$,selectCurrent:ee}=O_(k,C,j==null?void 0:j.id),re=_.useMemo(()=>T?k.map(K=>K.id===T.id?T:K):k,[k,T]),Y=_.useRef([]),le=_.useMemo(()=>{const K=j_(re,Y.current);return Y.current=K,K},[re]),xe=_.useMemo(()=>x_(k),[k]);_.useEffect(()=>{const K=document.querySelector("[data-virtuoso-scroller]");if(!K)return;const Se=150;let De=!1,Xe=null;const Qe=()=>{s.current=K.scrollHeight-K.scrollTop-K.clientHeight<Se},ue=()=>{De=!0,Xe&&clearTimeout(Xe),Xe=setTimeout(()=>{De=!1},200)},ge=()=>ue(),we=()=>ue(),Le=()=>ue(),qe=new MutationObserver(()=>{s.current&&!De&&(K.scrollTop=K.scrollHeight)});return K.addEventListener("scroll",Qe,{passive:!0}),K.addEventListener("wheel",ge,{passive:!0}),K.addEventListener("touchstart",we,{passive:!0}),K.addEventListener("touchend",Le,{passive:!0}),qe.observe(K,{childList:!0,subtree:!0}),K.scrollTop=K.scrollHeight,s.current=!0,()=>{K.removeEventListener("scroll",Qe),K.removeEventListener("wheel",ge),K.removeEventListener("touchstart",we),K.removeEventListener("touchend",Le),qe.disconnect(),Xe&&clearTimeout(Xe)}},[j==null?void 0:j.id]);const Te=_.useCallback(()=>{const K=w.current;if(!K)return;K.style.height="auto";const Se=Math.min(200,K.scrollHeight);K.style.height=`${Se}px`},[]);_.useEffect(()=>{if(!(j!=null&&j.id))return;const K=`openfox:draft:${j.id}`,Se=localStorage.getItem(K);Se!==null&&i(Se)},[j==null?void 0:j.id]),_.useEffect(()=>{var K;(K=w.current)==null||K.focus(),Te()},[j==null?void 0:j.id,Te]),_.useEffect(()=>{if(!(j!=null&&j.id))return;const K=`openfox:draft:${j.id}`,Se=setTimeout(()=>{l?localStorage.setItem(K,l):localStorage.removeItem(K)},500);return()=>clearTimeout(Se)},[j==null?void 0:j.id,l]),_.useEffect(()=>{Te()},[l,Te]),_.useEffect(()=>{const K=Se=>{Se.key==="Escape"&&I&&D()};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[I,D]),_.useEffect(()=>{const K=w.current;if(!K)return;const Se=De=>{var Qe;if(document.activeElement!==K)return;const Xe=(Qe=De.clipboardData)==null?void 0:Qe.items;if(Xe){for(const ue of Array.from(Xe))if(ue.type.startsWith("image/")){De.preventDefault();const ge=ue.getAsFile();if(!ge)continue;(async()=>{try{if(!Uf(ge)){x("Only PNG, JPG, and GIF images are supported.");return}const we=Ff(ge,50*1024*1024);if(!we.valid){x(we.error??"Image file is too large");return}const Le=await Hf(ge,{maxWidth:1920,maxHeight:1920,quality:.85,maxSizeBytes:1048576}),qe={id:uc(),filename:"pasted-image",mimeType:Le.mimeType,size:Le.size,data:Le.dataUrl};d(at=>[...at,qe])}catch(we){const Le=we instanceof Error?we.message??"Failed to process image":"Failed to process image";x(Le)}})()}}};return K.addEventListener("paste",Se),()=>K.removeEventListener("paste",Se)},[]);const je=()=>{i(""),d([]),j!=null&&j.id&&localStorage.removeItem(`openfox:draft:${j.id}`)},He=K=>{var Se;if(K.preventDefault(),Me){Q(l,c.length>0?c:void 0),je();return}if(!(!l.trim()&&c.length===0)){if(I){M(l,c.length>0?c:void 0),i(""),d([]);return}(Se=v.current)==null||Se.scrollToIndex({index:"LAST",behavior:"smooth"}),R(l,c),je()}},fe=K=>{if(A)switch(K.key){case"Enter":K.preventDefault();const Se=ee();Se&&(i(Se),W());return;case"Escape":K.preventDefault(),W(),I&&D();return;case"ArrowUp":K.preventDefault(),O();return;case"ArrowDown":K.preventDefault(),$();return}if(K.key==="ArrowUp"&&l.trim()===""&&!A){K.preventDefault(),z();return}K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),He(K))},Ce=_.useCallback(async K=>{const Se=K.target.files;if(!(!Se||Se.length===0)){x(null);for(const De of Array.from(Se))try{if(!Uf(De)){x(`Unsupported file type: ${De.type}. Only PNG, JPG, and GIF are supported.`);continue}const Xe=Ff(De,50*1024*1024);if(!Xe.valid){x(Xe.error??"Image file is too large");continue}const Qe=await Hf(De,{maxWidth:1920,maxHeight:1920,quality:.85,maxSizeBytes:1048576}),ue={id:uc(),filename:De.name,mimeType:Qe.mimeType,size:Qe.size,data:Qe.dataUrl};d(ge=>[...ge,ue])}catch(Xe){const Qe=Xe instanceof Error?Xe.message??"Failed to process image":"Failed to process image";x(Qe)}N.current&&(N.current.value="")}},[]),Re=_.useCallback(K=>{K.preventDefault(),K.stopPropagation(),p(!0)},[]),$e=_.useCallback(K=>{K.preventDefault(),K.stopPropagation(),p(!1)},[]),Je=_.useCallback(async K=>{K.preventDefault(),K.stopPropagation(),p(!1),x(null);const Se=K.dataTransfer.files;if(!(!Se||Se.length===0))for(const De of Array.from(Se))try{if(!Uf(De)){x(`Unsupported file type: ${De.type}. Only PNG, JPG, and GIF are supported.`);continue}const Xe=Ff(De,50*1024*1024);if(!Xe.valid){x(Xe.error??"Image file is too large");continue}const Qe=await Hf(De,{maxWidth:1920,maxHeight:1920,quality:.85,maxSizeBytes:1048576}),ue={id:uc(),filename:De.name,mimeType:Qe.mimeType,size:Qe.size,data:Qe.dataUrl};d(ge=>[...ge,ue])}catch(Xe){const Qe=Xe instanceof Error?Xe.message??"Failed to process image":"Failed to process image";x(Qe)}},[]),Ge=_.useCallback(K=>{d(Se=>Se.filter(De=>De.id!==K))},[]),vt=_.useCallback(()=>{var K;(K=N.current)==null||K.click()},[]),Tt=(j==null?void 0:j.mode)==="planner",Gt=(j==null?void 0:j.mode)==="builder",en=((j==null?void 0:j.criteria.length)??0)>0,At=(j==null?void 0:j.phase)==="done",kn=((j==null?void 0:j.criteria.filter(K=>K.status.type!=="passed"))??[]).length>0,ce=le.some(K=>K.type==="message"&&K.message.role==="assistant"),ve=Tt&&en&&!I&&ce&&!At,Me=Gt&&kn&&!I&&!At;return u.jsxs(VN,{criteriaSidebarOpen:e,messages:re,children:[G&&u.jsx(i_,{confirmation:G}),u.jsx(XN,{criteriaSidebarOpen:e,onCriteriaSidebarToggle:()=>n(!e)}),u.jsx(rN,{ref:v,data:le,className:"flex-1 min-w-0 overflow-x-hidden",increaseViewportBy:{top:500,bottom:200},defaultItemHeight:120,itemContent:(K,Se)=>{if(Se.type==="context-divider")return u.jsxs("div",{className:"flex items-center gap-2 feed-item px-2 md:px-4",children:[u.jsx("div",{className:"flex-1 border-t border-border"}),u.jsx("span",{className:"text-[10px] text-text-muted font-medium px-2",children:"Earlier context summarized"}),u.jsx("div",{className:"flex-1 border-t border-border"})]});if(Se.type==="subagent"){const Xe=Se.messages.some(Qe=>Qe.isStreaming);return u.jsx("div",{className:"px-2 md:px-4",children:u.jsx(n_,{messages:Se.messages,subAgentType:Se.subAgentType,isStreaming:Xe})})}if(Se.type==="criteria-batch")return u.jsx("div",{className:"feed-item px-2 md:px-4",children:u.jsx(F1,{toolCalls:Se.toolCalls,criteria:j==null?void 0:j.criteria})});const De=Se.message;return De.role==="assistant"?u.jsx("div",{className:"px-2 md:px-4",children:u.jsx(op,{message:De,showStats:!0})}):u.jsx("div",{className:"px-2 md:px-4",children:u.jsx($1,{message:De,isLastAssistantMessage:!1,promptContext:De.role==="user"?xe[De.id]:void 0})})},components:{Header:()=>u.jsx("div",{className:"pt-4"}),Footer:()=>u.jsxs("div",{className:"px-2 md:px-4 pb-4",children:[L&&u.jsx("div",{className:"feed-item bg-red-500/10 border border-red-500/50 rounded p-2",children:u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-red-400 text-sm font-medium",children:L.code}),u.jsx("div",{className:"text-red-300 text-xs mt-0.5",children:L.message})]}),u.jsx("button",{onClick:X,className:"text-red-400 hover:text-red-300 p-0.5","aria-label":"Dismiss error",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}),ve&&u.jsx("div",{className:"flex justify-center gap-2 feed-item flex-wrap",children:B.map(K=>{const Se=K.color??"#3b82f6",De=parseInt(Se.slice(1,3),16),Xe=parseInt(Se.slice(3,5),16),Qe=parseInt(Se.slice(5,7),16),ue=`rgba(${De},${Xe},${Qe},0.12)`,ge=`rgba(${De},${Xe},${Qe},0.22)`,we=`rgba(${De},${Xe},${Qe},0.25)`;return u.jsxs("button",{onClick:()=>U(K.id),className:"px-4 py-1.5 rounded text-sm font-medium transition-colors",style:{backgroundColor:ue,color:Se,border:`1px solid ${we}`},onMouseEnter:Le=>{Le.currentTarget.style.backgroundColor=ge},onMouseLeave:Le=>{Le.currentTarget.style.backgroundColor=ue},children:["▶ ",K.name]},K.id)})}),I&&u.jsx(a_,{})]})}}),u.jsxs("form",{onSubmit:He,className:"p-2 md:p-4 border-t border-border bg-gradient-to-t from-bg-secondary/50 to-transparent",children:[u.jsx("input",{ref:N,type:"file",accept:".png,.jpg,.jpeg,.gif",onChange:Ce,className:"hidden",multiple:!0}),m&&u.jsx("div",{className:"mb-2 p-2 bg-red-500/10 border border-red-500/50 rounded text-red-300 text-sm",children:m}),c.length>0&&u.jsx("div",{className:"mb-3 flex flex-wrap gap-2",children:c.map(K=>u.jsx(s_,{attachment:K,onRemove:Ge},K.id))}),A&&u.jsx(o_,{history:oe,selectedIndex:ae,onSelect:K=>{i(K),W()},onEscape:W,onNavigate:K=>{K==="up"?O():$()}}),q.length>0&&u.jsx("div",{className:"mb-2 flex flex-wrap gap-1.5",children:q.map(K=>u.jsxs("div",{className:`inline-flex items-center gap-1.5 px-2 py-1 rounded text-xs ${K.mode==="asap"?"bg-amber-500/15 text-amber-300 border border-amber-500/30":"bg-blue-500/15 text-blue-300 border border-blue-500/30"}`,children:[u.jsxs("span",{className:"font-medium",children:[K.mode==="asap"?"ASAP":"Queue",":"]}),u.jsx("span",{className:"truncate max-w-[200px]",children:K.content}),u.jsx("button",{type:"button",onClick:()=>H(K.queueId),className:"hover:text-white transition-colors",children:u.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},K.queueId))}),u.jsxs("div",{className:`flex items-end gap-3 p-3 rounded border transition-colors ${f?"border-accent-primary/50 bg-accent-primary/10":I?"border-accent-warning/30 bg-accent-warning/5":"border-border bg-bg-tertiary/50"}`,onDragOver:Re,onDragLeave:$e,onDrop:Je,children:[u.jsx("button",{type:"button",onClick:vt,className:"p-3 rounded hover:bg-bg-tertiary text-text-muted hover:text-text-primary transition-colors",title:"Attach image file",children:u.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"})})}),u.jsx("textarea",{ref:w,value:l,onChange:K=>{i(K.target.value),A&&W()},onKeyDown:fe,placeholder:Tt?"What would you like to build?":"Send a message...",className:"flex-1 bg-transparent text-sm placeholder:text-text-muted resize-none overflow-y-auto focus:outline-none",style:{minHeight:"24px",maxHeight:"200px"}}),I?u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("button",{type:"button",onClick:()=>{(l.trim()||c.length>0)&&(M(l,c.length>0?c:void 0),i(""),d([]))},disabled:!l.trim()&&c.length===0,className:"px-3 py-1.5 rounded bg-amber-500/20 text-sm text-amber-400 font-medium hover:bg-amber-500/30 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:"Send ASAP"}),u.jsx("button",{type:"button",onClick:()=>{(l.trim()||c.length>0)&&(V(l,c.length>0?c:void 0),i(""),d([]))},disabled:!l.trim()&&c.length===0,className:"px-3 py-1.5 rounded bg-blue-500/20 text-sm text-blue-400 font-medium hover:bg-blue-500/30 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:"Queue"})]}):u.jsxs("div",{className:"flex flex-col items-end gap-1",children:[u.jsx(y_,{onSendCommand:(K,Se)=>{var De;Se&&(j==null?void 0:j.mode)!==Se&&Ae.getState().switchMode(Se),(De=v.current)==null||De.scrollToIndex({index:"LAST",behavior:"smooth"}),R(K,void 0,{messageKind:"command",isSystemGenerated:!0})},onOpenManager:()=>y(!0)}),u.jsxs("div",{className:"flex items-center gap-2",children:[Me&&u.jsx("button",{type:"button",onClick:()=>{Q(l,c.length>0?c:void 0),je()},className:"px-4 py-1.5 rounded bg-accent-success/20 text-sm text-accent-success font-medium hover:bg-accent-success/30 transition-colors",children:"Launch"}),u.jsx("button",{type:"button",onClick:()=>{var K;!l.trim()&&c.length===0||((K=v.current)==null||K.scrollToIndex({index:"LAST",behavior:"smooth"}),R(l,c),je())},disabled:!l.trim()&&c.length===0,className:"px-4 py-1.5 rounded bg-accent-primary/20 text-sm text-accent-primary font-medium hover:bg-accent-primary/30 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:"Send"})]})]})]}),u.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[u.jsx(r_,{}),u.jsx(b_,{})]})]}),u.jsx(S_,{isOpen:b,onClose:()=>y(!1)})]})}const R_={sm:"w-4 h-4",md:"w-8 h-8",lg:"w-12 h-12"};function q1({size:e="md",className:n=""}){return u.jsx("div",{className:`animate-spin border-2 border-accent-primary border-t-transparent rounded-full ${R_[e]} ${n}`})}function M_({text:e,...n}){return u.jsxs("div",{className:"text-center",children:[u.jsx(q1,{...n,className:"mx-auto mb-4"}),e&&u.jsx("div",{className:"text-text-secondary",children:e})]})}function V1(){return u.jsx("div",{className:"flex-1 flex items-center justify-center",children:u.jsx(q1,{})})}function z_({sidebarOpen:e,onSidebarToggle:n}){const[,l]=E0("/p/:projectId"),i=l==null?void 0:l.projectId,s=Ae(m=>m.connectionStatus),c=Ae(m=>m.listSessions),d=Ae(m=>m.clearSession),f=Jt(m=>m.currentProject),p=Jt(m=>m.loadProject);return _.useEffect(()=>{s==="connected"&&i&&((f==null?void 0:f.id)!==i&&p(i),c(),d())},[s,i,f==null?void 0:f.id,p,c,d]),!f||f.id!==i?u.jsx(V1,{}):u.jsxs(u.Fragment,{children:[u.jsx(B0,{projectId:i,isOpen:e,onClose:n}),u.jsx("div",{className:"flex-1 min-w-0 bg-bg-primary",children:u.jsx(Xk,{})})]})}function D_({sidebarOpen:e,onSidebarToggle:n}){const[,l]=E0("/p/:projectId/s/:sessionId"),i=l==null?void 0:l.projectId,s=l==null?void 0:l.sessionId,[,c]=Zr(),d=Ae(w=>w.connectionStatus),f=Ae(w=>w.currentSession),p=Ae(w=>w.loadSession),m=Ae(w=>w.listSessions),x=Ae(w=>w.error),b=Ae(w=>w.clearError),y=Jt(w=>w.currentProject),v=Jt(w=>w.loadProject);return _.useEffect(()=>{d==="connected"&&i&&(y==null?void 0:y.id)!==i&&v(i)},[d,i,y==null?void 0:y.id,v]),_.useEffect(()=>{d==="connected"&&s&&(f==null?void 0:f.id)!==s&&p(s),d==="connected"&&m()},[d,s,f==null?void 0:f.id,p,m]),_.useEffect(()=>{(x==null?void 0:x.code)==="NOT_FOUND"&&i&&(b(),c(`/p/${i}`))},[x,i,b,c]),!y||y.id!==i?u.jsx(V1,{}):u.jsxs(u.Fragment,{children:[u.jsx(B0,{projectId:i,isOpen:e,onClose:n}),u.jsx("div",{className:"flex-1 min-w-0 bg-bg-primary",children:u.jsx(__,{})})]})}function L_(){const{connectionStatus:e}=hk(),n=Nn(c=>c.fetchConfig),l=Jt(c=>c.handleServerMessage),[i,s]=_.useState(!1);return _.useEffect(()=>{n()},[n]),_.useEffect(()=>{},[l]),e!=="connected"?u.jsx("div",{className:"h-screen flex items-center justify-center",children:u.jsx(M_,{text:e==="reconnecting"?"Reconnecting...":"Connecting to server..."})}):u.jsxs("div",{className:"h-screen flex flex-col",children:[u.jsx(Gk,{}),u.jsx(Hk,{onMenuClick:()=>s(!i)}),u.jsx("div",{className:"flex-1 flex overflow-hidden",children:u.jsxs(Fw,{children:[u.jsx(df,{path:"/p/:projectId/s/:sessionId",children:u.jsx(D_,{sidebarOpen:i,onSidebarToggle:()=>s(!1)})}),u.jsx(df,{path:"/p/:projectId",children:u.jsx(z_,{sidebarOpen:i,onSidebarToggle:()=>s(!1)})}),u.jsx(df,{path:"/",children:u.jsx(Yk,{})})]})})]})}bw.createRoot(document.getElementById("root")).render(u.jsx(ke.StrictMode,{children:u.jsx(L_,{})}));